﻿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;*/
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

img{
    max-width:100%;
    max-height:100%;
}

.form-control[readonly],
.form-select[readonly],
textarea.form-control[readonly] {
    background-color: var(--bs-secondary-bg);
    border-style: dashed;
    border-color: var(--bs-border-color);
    color: var(--bs-secondary-color);
    cursor: not-allowed;
}

.form-control[readonly]:focus,
textarea.form-control[readonly]:focus {
    box-shadow: none;
    border-color: var(--bs-border-color);
}

.fs-7 {
    font-size: 0.9em !important;
}
.fs-8{
    font-size:0.8em!important;
}
.ws-nw {
    white-space: nowrap !important;
}

button.is-loading {
    pointer-events: none;
    opacity: .7;
    cursor: not-allowed;
}

/* 10 badge custom (non Bootstrap base) */

/* Teal (petrolio chiaro) */
.text-bg-custom-1 {
    color: #052a2d !important;
    background-color: rgba(70, 199, 197, var(--bs-bg-opacity, 1)) !important;
}

/* Indigo (indaco moderno) */
.text-bg-custom-2 {
    color: #120a2a !important;
    background-color: rgba(154, 140, 255, var(--bs-bg-opacity, 1)) !important;
}

/* Coral (corallo) */
.text-bg-custom-3 {
    color: #3b1010 !important;
    background-color: rgba(255, 140, 122, var(--bs-bg-opacity, 1)) !important;
}

/* Mint (menta) */
.text-bg-custom-4 {
    color: #0f2a1d !important;
    background-color: rgba(152, 241, 196, var(--bs-bg-opacity, 1)) !important;
}

/* Sand (sabbia) */
.text-bg-custom-5 {
    color: #2f2412 !important;
    background-color: rgba(239, 209, 160, var(--bs-bg-opacity, 1)) !important;
}

/* Slate (ardesia) */
.text-bg-custom-6 {
    color: #0b1220 !important;
    background-color: rgba(161, 180, 206, var(--bs-bg-opacity, 1)) !important;
}

/* Rose (rosa polveroso) */
.text-bg-custom-7 {
    color: #2f0f1c !important;
    background-color: rgba(255, 170, 210, var(--bs-bg-opacity, 1)) !important;
}

/* Lime (lime soft) */
.text-bg-custom-8 {
    color: #1f2a05 !important;
    background-color: rgba(206, 234, 110, var(--bs-bg-opacity, 1)) !important;
}

/* Copper (rame) */
.text-bg-custom-9 {
    color: #2b1206 !important;
    background-color: rgba(226, 145, 92, var(--bs-bg-opacity, 1)) !important;
}

/* Azure (azzurro vivo ma non "info") */
.text-bg-custom-10 {
    color: #071a35 !important;
    background-color: rgba(120, 180, 255, var(--bs-bg-opacity, 1)) !important;
}

/* Urgenze */
.text-bg-urg-bassa {
    color: #000000 !important;
    background-color: rgba(173, 181, 189, var(--bs-bg-opacity, 1)) !important;
}

.text-bg-urg-media {
    color: #000000 !important;
    background-color: rgba(255, 193, 7, var(--bs-bg-opacity, 1)) !important;
}

.text-bg-urg-alta {
    color: #000000 !important;
    background-color: rgba(255, 119, 7, var(--bs-bg-opacity, 1)) !important;
}

.text-bg-urg-altissima {
    color: #000000 !important;
    background-color: rgba(123, 7, 255, var(--bs-bg-opacity, 1)) !important;
}


/* ========== Login page (ARXivar Portal) ========== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: radial-gradient(1200px circle at 10% 10%, rgba(13,110,253,.18), transparent 50%), radial-gradient(1000px circle at 90% 20%, rgba(25,135,84,.14), transparent 55%), #f8f9fa;
    margin: 0px;
}

.login-card {
    border: 0;
    box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, .12);
    border-radius: 1.25rem;
    overflow: hidden;
}

.login-card .card-body {
    padding: 2rem;
}

@media (min-width: 768px) {
    .login-card .card-body {
        padding: 3rem;
    }
}

.login-logo {
    height: 80px;
    width: auto;
}

.login-subtitle {
    color: #6c757d;
    font-size: .9rem;
}

.login-footer {
    color: #6c757d;
    font-size: .8rem;
}

.login-input {
    font-size: 1.05rem;
    padding-top: .75rem;
    padding-bottom: .75rem;
}

/* ===== Layout (header + footer) ===== */
.td-body {
    background: #f6f7fb;
}

.td-header {
    position: sticky;
    top: 0;
    z-index: 1020;
    backdrop-filter: blur(10px);
    background: rgba(246,247,251,.75);
    border-bottom: 1px solid rgba(15,23,42,.08);
}

.td-navbar {
    padding: 10px 0;
}

.td-dropdown {
    border-radius: 14px;
    border: 1px solid rgba(15,23,42,.10);
    box-shadow: 0 16px 30px rgba(15,23,42,.10);
    padding: 8px;
}

.td-dropdown__item {
    border-radius: 10px;
    padding: 10px 12px;
    font-weight: 600;
}

.td-dropdown__item:hover {
    background: rgba(99,102,241,.10);
}

.td-navlink.active {
    background: rgba(99,102,241,.14);
    color: #0f172a !important;
}

.td-dropdown__item.active {
    background: rgba(99,102,241,.14);
    color: #0f172a;
}

.td-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.td-brand__mark {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-weight: 900;
    letter-spacing: -.5px;
    color: #fff;
    background: linear-gradient(135deg, #6366f1, #22c55e);
    box-shadow: 0 10px 20px rgba(15,23,42,.12);
}

.td-brand__text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.td-brand__title {
    font-weight: 800;
    letter-spacing: -.2px;
    color: #0f172a;
}

.td-brand__subtitle {
    font-size: 12px;
    color: rgba(15,23,42,.55);
}

.td-logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 12px;
    background: #fff;
    padding: 3px;
    border: 1px solid rgba(15, 23, 42, .10);
    box-shadow: 0 10px 20px rgba(15, 23, 42, .10);
}

.td-toggler {
    border-radius: 12px;
    border: 1px solid rgba(15,23,42,.12);
}

.td-navlink {
    border-radius: 12px;
    padding: 10px 12px !important;
    color: rgba(15,23,42,.75) !important;
    font-weight: 600;
}

.td-navlink:hover {
    background: rgba(99,102,241,.10);
    color: #0f172a !important;
}

.td-user {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 999px;
    border: 1px solid rgba(15,23,42,.10);
    background: #fff;
    box-shadow: 0 10px 18px rgba(15,23,42,.06);
}

.td-user__dot {
    width: 8px;
    height: 8px;
    border-radius: 99px;
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34,197,94,.12);
}

.td-user__name {
    font-size: 13px;
    font-weight: 700;
    color: rgba(15,23,42,.85);
}

.td-btn {
    border-radius: 12px;
    padding: 9px 12px;
    font-weight: 700;
}

.td-btn--ghost {
    border: 1px solid rgba(15,23,42,.14);
    background: #fff;
    color: rgba(15,23,42,.80);
}

.td-btn--ghost:hover {
    background: rgba(239,68,68,.08);
    border-color: rgba(239,68,68,.25);
    color: #ef4444;
}

.td-main {
    padding-top: 18px;
    padding-bottom: 40px;
}

.td-footer {
    border-top: 1px solid rgba(15,23,42,.08);
    background: #fff;
    padding: 14px 0;
}

.td-footer__pill {
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(99,102,241,.10);
    border: 1px solid rgba(99,102,241,.18);
    color: rgba(15,23,42,.70);
    font-weight: 700;
}

.td-footer__dot {
    opacity: .5;
}

.text-prewrap {
    white-space: pre-wrap;
}

.td-userchip {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .35rem .6rem;
    border: 1px solid rgba(0,0,0,.08);
    background: #fff;
    border-radius: 999px;
    cursor: pointer;
    transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease;
}

.td-userchip:hover {
    border-color: rgba(0,0,0,.15);
    box-shadow: 0 6px 18px rgba(0,0,0,.08);
    transform: translateY(-1px);
}

.td-userchip:focus {
    outline: 0;
    box-shadow: 0 0 0 .2rem rgba(13,110,253,.15);
}

.td-userchip__avatar {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: .8rem;
    background: rgba(13,110,253,.12);
    color: #0d6efd;
}

.td-userchip__name {
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
    font-size: .9rem;
    color: #212529;
}

@media (min-width: 991px) and (max-width: 1399.98px) {
    .td-brand {
        font-size:0.9em;
        gap:5px;
    }

    .td-userchip__name {
        display: none !important;
    }
}

.td-userchip__chev {
    opacity: .6;
    font-size: .85rem;
}

.td-userchip__menu {
    min-width: 220px;
    border-radius: 14px;
    padding: .35rem;
    box-shadow: 0 14px 40px rgba(0,0,0,.12);
    border: 1px solid rgba(0,0,0,.06);
}

.td-userchip__menu .dropdown-item {
    border-radius: 10px;
    padding: .55rem .7rem;
}

.td-userchip__menu .dropdown-item:active {
    background: rgba(13,110,253,.12);
    color: #0d6efd;
}

.td-table-card {
    border-radius: 16px;
    overflow: hidden;
}

.td-table {
    font-size: .92rem;
}

.td-sticky-head th {
    position: sticky;
    top: 0;
    z-index: 2;
}

.td-col-actions {
    width: 1%;
    white-space: nowrap;
}

.td-col-narrow {
    width: 120px;
}

.td-col-email {
    min-width: 220px;
}

.td-col-phone {
    width: 150px;
}

.td-col-status {
    width: 120px;
}

.td-status-icons i {
    line-height: 1;
}

.td-mono {
    font-variant-numeric: tabular-nums;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.td-ellipsis {
    max-width: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.td-link {
    text-decoration: none;
}

.td-link:hover {
    text-decoration: underline;
}

.td-rowcard {
    padding: 12px 14px;
}

.td-rowcard-top {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 8px 10px;
}

.td-rowcard-actions {
    order: 1;
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.td-rowcard-title {
    order: 2;
    flex: 0 0 100%;
    width: 100%;
    font-weight: 800;
    line-height: 1.15;
    word-break: break-word;
}

.td-rowcard-grid {
    margin-top: 10px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 12px;
}

.td-field .td-label {
    font-size: .75rem;
    color: rgba(15,23,42,.6);
}

.td-field .td-value {
    font-size: .92rem;
}

.td-sort-link {
    color: inherit;
    text-decoration: none;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}

.td-sort-link:hover {
    text-decoration: underline;
}

.td-sort-ic {
    opacity: .55;
    font-size: .85rem;
}

.td-prewrap {
    white-space: pre-line;
}

.td-desc {
    max-width: 0; 
}

.td-desc .td-clamp-3 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3; 
    overflow: hidden;
    word-break: break-word;
    white-space: normal;
}

.td-desc-box{text-align:justify;}

.td-desc-box .td-full {
    display: none;
    white-space: pre-wrap;
    word-break: break-word;
}

.td-desc-box.is-open .td-clamp-3 {
    display: none;
}

.td-desc-box.is-open .td-full {
    display: block;
}

.badge.badgefontnormal{
    font-size:1em;
}

@media (max-width: 380px) {
    .td-rowcard-grid {
        grid-template-columns: 1fr;
    }
}

.td-initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.05rem;
    height: 1.55rem;
    border-radius: var(--bs-border-radius);
    font-weight: 700;
    font-size: .75rem;
    letter-spacing: .02em;
    border: 1px solid rgba(0,0,0,.08);
    user-select: none;
}

.td-initials.td-initials-big {
    width: auto;
    padding: 0px 4px;
}

.td-initials i {
    font-size: .95rem;
}

.client-topbar {
    padding: .9rem 1rem;
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 1rem;
    background: var(--bs-body-bg);
    box-shadow: 0 .125rem .75rem rgba(0,0,0,.05);
}

.min-w-0 {
    min-width: 0;
}

@media (min-width:576px) {
    .w-sm-auto {
        width: auto !important;
    }
}

.kv-list {
    display: grid;
    gap: .25rem;
}

.kv-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: .15rem;
    padding: .5rem 0;
    border-bottom: 1px dashed rgba(0,0,0,.12);
}

.kv-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.kv-row dt {
    margin: 0;
    color: var(--bs-secondary-color);
    font-size: .85rem;
}

.kv-row dd {
    margin: 0;
    font-weight: 500;
    word-break: break-word;
}

@media (min-width:576px) {
    .kv-row {
        grid-template-columns: 180px 1fr;
        gap: .75rem;
        align-items: baseline;
    }

    .kv-row dt {
        font-size: .875rem;
    }
}

.td-dl-dashed dd {
    padding-bottom: .75rem;
    margin-bottom: .75rem;
    border-bottom: 1px dashed rgba(0, 0, 0, .12);
}

.sede-item {
    background: var(--bs-body-bg);
}

.sede-note {
    border-top: 1px dashed rgba(0,0,0,.12);
}

.sede-note-badge {
    white-space: nowrap;
}


.td-truncate {
    max-width: 280px; /* regola a gusto */
    /*white-space: nowrap;*/
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Mobile cards */
.imp-card {
    background: var(--bs-body-bg);
}

.imp-kv {
    display: grid;
    gap: .75rem;
}

.imp-label {
    color: var(--bs-secondary-color);
    font-size: .85rem;
}

.imp-value {
    font-weight: 500;
    word-break: break-word;
}

.imp-addr-link {
    color: inherit;
    text-decoration: none;
}

.imp-addr-link:active,
.imp-addr-link:hover {
    text-decoration: underline;
}

.td-section-title {
    font-weight: 600;
    margin-bottom: .75rem;
}

.td-manual-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: .5rem;
}

@media (min-width: 768px) {
    .td-manual-grid {
        grid-template-columns: 1fr 1fr;
    }
}

#attachmentsCard [data-td-att-dropzone].dragover {
    outline: 2px dashed currentColor;
    outline-offset: 2px;
}

#attachmentsCard .file-name {
    max-width: 420px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 576px) {
    #attachmentsCard .file-name {
        max-width: 220px;
    }
}

.btn-check:checked + .card {
    background: #bcd0ed;
}

#contrattiList .list-group-item.td-selected {
    border-color: rgba(13,110,253,.55);
    box-shadow: 0 0 0 .2rem rgba(13,110,253,.15);
}

#contrattiList .td-check {
    display: none;
}

#contrattiList .list-group-item.td-selected .td-check {
    display: inline-flex;
}

.td-status-responsive {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    flex-wrap: nowrap; 
    line-height: 1;
}

.td-icons-row {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}

.td-stato-pill {
    font-size: .75rem;
    padding: .25rem .55rem;
    white-space: nowrap;
    max-width: 10rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (min-width: 768px) {
    .td-status-responsive {
        flex-direction: column;
        align-items: center;
    }
}

/* === Select2 come input Bootstrap, senza overflow-x === */

.select2-container {
    width: 100% !important;
    max-width: 100% !important;
}

.select2-container .select2-selection--single {
    height: calc(1.5em + .75rem + 2px) !important;
    border: 1px solid #ced4da !important;
    border-radius: .375rem !important;
    background-color: #fff !important;
    box-sizing: border-box !important;
    overflow: hidden !important; /* evita scroll orizzontale */
    max-width: 100% !important;
}

/* Il padding va qui, non sulla selection */
.select2-container .select2-selection--single .select2-selection__rendered {
    box-sizing: border-box !important;
    padding: .375rem 2.25rem .375rem .75rem !important; /* spazio freccia a dx */
    line-height: 1.5 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Freccia: non deve “allargare” */
.select2-container .select2-selection--single .select2-selection__arrow {
    height: 100% !important;
    width: 2.25rem !important;
    right: 0 !important;
    top: 0 !important;
}

/* Clear (x) */
.select2-container .select2-selection__clear {
    position: absolute !important;
    right: 2.25rem !important; /* prima della freccia */
    top: 50% !important;
    transform: translateY(-50%) !important;
    margin: 0 !important;
}

/* Focus stile Bootstrap */
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: #86b7fe !important;
    box-shadow: 0 0 0 .25rem rgba(13,110,253,.25) !important;
}

/* Dropdown */
.select2-dropdown {
    border: 1px solid #ced4da !important;
    border-radius: .375rem !important;
    box-sizing: border-box !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
}

.select2-container--default .select2-dropdown.select2-dropdown--below {
    min-width: 200px;
}

.select2-container--default .select2-dropdown {
    overflow-x: hidden;
}

/* Risultati */
.select2-results__option {
    padding: .375rem .75rem !important;
}

.select2-container--default .select2-results__option .bi {
    line-height: 1;
}

.select2-container--default .select2-results__option > span {
    display: inline-flex;
    max-width: 100%;
}

.select2-container--default .select2-results__option span span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.select2-results {
    overflow-x: hidden !important;
}

.select2-container.select2-container--default.select2-container--open:not(.select2) {
    width: auto !important;
}

.modal-dialog-scrollable .modal-content {
    overflow: auto!important;
}


/* buoni lavoro orari */

.orario-grid {
    display: grid;
    gap: .75rem;
}

.orario-head {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: .5rem;
}

.orario-title {
    font-weight: 600;
}

/* Mobile default: layout impilato */
.orario-grid {
    grid-template-columns: 1fr 1fr;
}

/* Campi che devono occupare tutta larghezza in mobile */
.orario-head,
.orario-notes,
.orario-tech {
    grid-column: 1 / -1;
}

/* Campi singoli in 2 colonne su mobile */
.orario-field {
    min-width: 0;
}

/* Tecnici: box scrollabile */
.orario-tech-box {
    border: 1px solid rgba(0,0,0,.15);
    border-radius: .5rem;
    padding: .5rem;
    max-height: 160px; /* mobile */
    overflow: auto;
    background: rgba(0,0,0,.02);
}

/* Desktop: più “tabellare” */
@media (min-width: 992px) {
    .orario-grid {
        grid-template-columns: 140px 140px 140px 140px 140px 140px 160px 1fr;
        align-items: start;
    }

    /* Header sopra tutta la riga */
    .orario-head {
        grid-column: 1 / -1;
    }

    /* Note e tecnici a destra in colonna larga */
    .orario-notes {
        grid-column: 1 / 6;
    }
    /* note più ampia */
    .orario-tech {
        grid-column: 6 / -1;
    }
    /* tecnici a destra */

    .orario-tech-box {
        max-height: 220px;
    }
}

.materiali-table-head {
    display: grid;
    grid-template-columns: 120px minmax(280px, 1fr) 100px 130px 100px 100px;
    gap: .75rem;
    padding: 0 .75rem .35rem .75rem;
    font-size: .85rem;
    font-weight: 700;
    color: var(--bs-secondary-color);
}

.materiali-table-head.no-prezzi {
    grid-template-columns: 120px minmax(280px, 1fr) 100px;
}

.materiali-table-row {
    display: grid;
    grid-template-columns: 120px minmax(280px, 1fr) 100px 130px 100px 100px;
    gap: .75rem;
    align-items: start;
}

.materiali-table-row.no-prezzi {
    grid-template-columns: 120px minmax(280px, 1fr) 100px;
}

.materiali-table-row > div {
    min-width: 0;
}

.materiali-table-row .form-control,
.materiali-table-row .form-select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.materiali-table-row .input-group .form-control,
.materiali-table-row .input-group .form-select {
    width: 1%;
}

.materiali-table-row .form-control.materiale-articolo-descagg {
    display: inline-block;
    width: calc(100% - 105px);
    margin-top: 5px;
    border-color: #0d6efd;
}

.materiali-table-row .form-control.materiale-articolo-unimis {
    margin-top: 5px;
    border-color: #0d6efd;
    display: inline-block;
    width: 100px;
}

.materiale-mobile-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
}

.materiale-title {
    min-width: 0;
    font-size: 1rem;
    line-height: 1.2;
}

.materiale-item {
    padding: .75rem !important;
}

@media (max-width: 991.98px) {
    .materiali-table-row {
        grid-template-columns: minmax(80px, 90px) minmax(0, 1fr);
        gap: .85rem .9rem;
    }

    .materiali-table-row.no-prezzi {
        grid-template-columns: minmax(80px, 90px) minmax(0, 1fr);
    }

    .materiali-table-row > div {
        min-width: 0;
    }

    .materiali-table-row .form-control,
    .materiali-table-row .form-select {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .materiali-table-row > div:last-child {
        grid-column: 1 / -1;
    }

    .materiali-table-row.no-prezzi > div:last-child {
        grid-column: 1 / -1;
    }

    .materiali-actions {
        display: flex;
        justify-content: flex-start;
    }
}

@media (max-width: 575.98px) {
    .materiale-item {
        padding: 0.5rem !important;
    }

    .materiale-title {
        font-size: 1rem;
    }
}

.td-signature-pad {
    width: 100%;
    aspect-ratio: 3 / 1; /* <-- scegli: 3/1 oppure 16/9 */
    border: 1px solid rgba(0,0,0,.15);
    border-radius: .75rem;
    background: #fff;
    overflow: hidden;
}

.td-signature-pad canvas {
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
}

.td-hasbar {
    position: relative;
    padding-left: 15px!important;
}

.td-hasbar::before {
    content: "";
    position: absolute;
    left: 0;
    top: 5px;
    bottom: 5px;
    width: 10px;
    border-radius: 2px;
    background: var(--td-bar, #adb5bd);
}

/* MAPPA */
.td-pin {
    width: 26px;
    height: 26px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,.25);
    position: relative;
}

.td-pin::after {
    content: "";
    width: 10px;
    height: 10px;
    background: rgba(255,255,255,.95);
    border-radius: 50%;
    position: absolute;
    top: 8px;
    left: 8px;
}

.td-pin--default,
.td-pin--bassa {
    background: #adb5bd;
}

.td-pin--media {
    background: #ffee00;
}

.td-pin--alta {
    background: #ff6300;
}

.td-pin--altissima {
    background: #7b07ff;
}

.td-zone {
    border: 1px solid rgba(0,0,0,.1);
    font-weight: 600;
}

.td-zone--0 {
    background: #e7f1ff;
    color: #084298;
}

.td-zone--1 {
    background: #e8f5e9;
    color: #1b5e20;
}

.td-zone--2 {
    background: #fff3cd;
    color: #664d03;
}

.td-zone--3 {
    background: #f8d7da;
    color: #842029;
}

.td-zone--4 {
    background: #cff4fc;
    color: #055160;
}

.td-zone--5 {
    background: #e2e3e5;
    color: #41464b;
}

.td-zone--6 {
    background: #f1e8ff;
    color: #3d1a7a;
}

.td-zone--7 {
    background: #ffe8cc;
    color: #7a3a00;
}

.td-map-hq-wrapper {
    background: transparent;
    border: 0;
}

.td-map-hq-marker {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #0d6efd;
    color: #fff;
    border: 2px solid #fff;
    box-shadow: 0 4px 12px rgba(13, 110, 253, .28);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.td-map-am-marker {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #0d6efd;
    color: #fff;
    border: 2px solid #fff;
    box-shadow: 0 4px 12px rgba(13, 110, 253, .28);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.td-map-popup--sede .fw-semibold {
    color: #0d6efd;
}

.td-map-tooltip-wrap {
    background: transparent;
    border: 0;
    box-shadow: none;
}

    .td-map-tooltip-wrap .leaflet-tooltip-content {
        margin: 0;
    }

.td-map-tooltip {
    max-width: 220px;
    padding: .4rem .55rem;
    border-radius: .75rem;
    background: rgba(255, 255, 255, .96);
    border: 1px solid rgba(0, 0, 0, .08);
    box-shadow: 0 .2rem .65rem rgba(0, 0, 0, .12);
    line-height: 1.25;
}

.td-map-tooltip__title {
    font-size: .8rem;
    font-weight: 700;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.td-map-tooltip__address {
    margin-top: .15rem;
    font-size: .74rem;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.td-map-tooltip--sede {
    max-width: 260px;
    background: rgba(13, 110, 253, .96);
    color: #fff;
    border-color: rgba(13, 110, 253, .96);
}

.td-map-tooltip--sede .td-map-tooltip__title,
.td-map-tooltip--sede .td-map-tooltip__address {
    color: #fff;
}

/* MAPPA GOOGLE */

#gm-clienti-map {
    min-height: 520px;
}

.td-gmap-hq-marker {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #198754;
    color: #fff;
    border: 2px solid #fff;
    box-shadow: 0 4px 12px rgba(25, 135, 84, .28);
    font-size: 1rem;
    line-height: 1;
}

.td-gmap-am-marker {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0d6efd;
    color: #fff;
    border: 2px solid #fff;
    box-shadow: 0 4px 12px rgba(13, 110, 253, .28);
    font-size: 1rem;
    line-height: 1;
}

.td-gmap-tooltip {
    min-width: 220px;
    max-width: 280px;
    padding: .25rem 0 .1rem 0;
    line-height: 1.35;
}

.td-gmap-tooltip__title {
    font-size: 1rem;
    font-weight: 800;
    color: #1f2937;
    margin-bottom: .35rem;
    line-height: 1.25;
    word-break: break-word;
}

.td-gmap-tooltip__address {
    font-size: .92rem;
    color: #4b5563;
    line-height: 1.45;
    word-break: break-word;
}

.td-gmap-tooltip__meta {
    font-size: .8rem;
    color: #6b7280;
    margin-top: .45rem;
}

.td-gmap-tooltip__label {
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
    color: #9ca3af;
    margin-bottom: .2rem;
}

.td-gmap-tooltip__badge {
    display: inline-block;
    margin-bottom: .45rem;
    padding: .18rem .45rem;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-size: .72rem;
    font-weight: 700;
    line-height: 1;
}

.td-gmap-tooltip--sede {
    border-left: 4px solid #198754;
    padding-left: .7rem;
}

.td-gmap-tooltip--automezzo {
    border-left: 4px solid #0d6efd;
    padding-left: .7rem;
}

/* shell Google InfoWindow */
.gm-style .gm-style-iw-c {
    padding: 5px 20px !important;
    border-radius: 10px !important;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .16) !important;
}

.gm-style .gm-style-iw-d {
    overflow: hidden !important;
    padding: 0 !important;
}

.gm-style .gm-style-iw-tc::after {
    background: #fff !important;
}

.gm-style button.gm-ui-hover-effect {
    top: 0px !important;
    right: 0px !important;
    width: auto !important;
    height: auto !important;
    border-radius: 10px !important;
    background: #FFF !important;
    opacity: 1 !important;
    padding: 3px !important;
}

.gm-style button.gm-ui-hover-effect:hover {
    background: #f3f4f6 !important;
}

.gm-style button.gm-ui-hover-effect span{
    margin:0px!important;
    height:18px!important;
    width:18px!important;
}

.gm-style .gm-style-iw-ch{
    padding:0px!important;
}

.td-gmap-overlay-tooltip {
    position: absolute;
    z-index: 10;
    pointer-events: none;
}

.td-gmap-overlay-tooltip .td-gmap-tooltip {
    min-width: 180px;
    max-width: 240px;
    padding: .45rem .6rem;
    border-radius: .75rem;
    background: rgba(255,255,255,.96);
    border: 1px solid rgba(0,0,0,.08);
    box-shadow: 0 .25rem .85rem rgba(0,0,0,.16);
    line-height: 1.3;
}

.td-gmap-overlay-tooltip .td-gmap-tooltip__title {
    font-size: .88rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0px;
    text-align: center;
    line-height: 1em;
}

.td-gmap-overlay-tooltip .td-gmap-tooltip__address {
    display:none;
    font-size: .78rem;
    color: #6b7280;
}

.td-gmap-overlay-tooltip .td-gmap-tooltip__label {
    display:none;
    font-size: .78rem;
    color: #6b7280;
}

.td-gmap-pin-wrap {
    position: relative;
    width: 26px;
    height: 26px;
    transform: translateY(-6px);
}

.td-gmap-pin {
    width: 26px;
    height: 26px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,.25);
    background: var(--td-pin-color, #6c757d);
    position: relative;
}

.td-gmap-pin::after {
    content: "";
    width: 10px;
    height: 10px;
    background: rgba(255,255,255,.95);
    border-radius: 50%;
    position: absolute;
    top: 6px;
    left: 6px;
}

/* Dettaglio buono di lavoro - materiali / orari */
.td-summary-card {
    /*border: 1px solid rgba(0,0,0,.08);
    border-radius: 1rem;
    padding: 1rem;
    background: #fff;
    height: 100%;*/
}

.td-summary-card--highlight {
    background: rgba(13,110,253,.05);
    border-color: rgba(13,110,253,.18);
}

.td-detail-mobile-card {
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 1rem;
    padding: 1rem;
    background: #fff;
    height: 100%;
}

.td-detail-table th {
    white-space: nowrap;
    font-size: .85rem;
}

.td-detail-table td {
    vertical-align: top;
}

.td-prewrap {
    white-space: pre-wrap;
}

@media (max-width: 991.98px) {
    .td-detail-mobile-card .kv-row {
        grid-template-columns: 1fr;
    }
}

.td-kpi-card {
    border: 1px solid rgba(0, 0, 0, .08);
    border-radius: 1rem;
    box-shadow: 0 .125rem .25rem rgba(0, 0, 0, .04);
}

.td-kpi-card .card-body {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
}

.td-kpi-card__icon {
    width: 3rem;
    height: 3rem;
    flex: 0 0 3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(13, 110, 253, .08);
    color: var(--bs-primary);
    font-size: 1.25rem;
}

.td-kpi-card__content {
    min-width: 0;
}

.td-kpi-card__label {
    font-size: .9rem;
    color: var(--bs-secondary-color);
    margin-bottom: .25rem;
}

.td-kpi-card__value {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.1;
}

.td-kpi-card__hint {
    margin-top: .25rem;
    font-size: .8rem;
    color: var(--bs-secondary-color);
}

.td-kpi-card--highlight {
    background: linear-gradient(180deg, rgba(13,110,253,.04) 0%, rgba(13,110,253,.01) 100%);
    border-color: rgba(13,110,253,.18);
}

@media (max-width: 767.98px) {
    .td-kpi-card .card-body {
        align-items: flex-start;
    }

    .td-kpi-card__value {
        font-size: 1.35rem;
    }
}

.td-tipologia-hero {
    padding: 1rem 0 1.25rem 0;
}

.td-tipologia-hero__label {
    font-size: 1rem;
    font-weight: 700;
    color: #1f2a37;
}

.td-tipologia-hero__hint {
    color: var(--bs-secondary-color);
    font-size: .95rem;
    margin-bottom: 1rem;
}

.td-tipologia-picker {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .9rem;
}

.td-tipologia-btn {
    display: flex;
    align-items: flex-start;
    gap: .9rem;
    width: 100%;
    min-height: 104px;
    padding: 1rem 1rem;
    border: 1px solid rgba(13, 110, 253, .35);
    border-radius: 1rem;
    background: #fff;
    text-align: left;
    transition: .18s ease;
    box-shadow: 0 .125rem .25rem rgba(0, 0, 0, .04);
}

.td-tipologia-btn:hover {
    border-color: rgba(13, 110, 253, .7);
    box-shadow: 0 .35rem .9rem rgba(13, 110, 253, .10);
    transform: translateY(-1px);
}

.td-tipologia-btn:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 .25rem rgba(13, 110, 253, .18);
}

.td-tipologia-btn[aria-checked="true"] {
    background: linear-gradient(180deg, rgba(13,110,253,.10) 0%, rgba(13,110,253,.04) 100%);
    border-color: rgba(13, 110, 253, .9);
    box-shadow: 0 .5rem 1rem rgba(13, 110, 253, .14);
}

.td-tipologia-btn.is-selected {
    background: linear-gradient(180deg, rgba(13,110,253,.10) 0%, rgba(13,110,253,.04) 100%);
    border-color: rgba(13, 110, 253, .9);
}

.td-tipologia-btn__icon {
    width: 2.75rem;
    height: 2.75rem;
    flex: 0 0 2.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: .85rem;
    background: rgba(13, 110, 253, .08);
    color: var(--bs-primary);
    font-size: 1.2rem;
}

.td-tipologia-btn[aria-checked="true"] .td-tipologia-btn__icon {
    background: rgba(13, 110, 253, .16);
}

.td-tipologia-btn__content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.td-tipologia-btn__title {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.25;
}

.td-tipologia-btn__desc {
    margin-top: .35rem;
    font-size: .88rem;
    line-height: 1.35;
    color: var(--bs-secondary-color);
}

@media (max-width: 991.98px) {
    .td-tipologia-picker {
        grid-template-columns: 1fr;
    }

    .td-tipologia-btn {
        min-height: auto;
    }
}

.spese-table-head,
.spese-table-row {
    display: grid;
    grid-template-columns: 1.6fr 1.2fr 1fr 1fr 1.8fr 110px;
    gap: 0.75rem;
    align-items: start;
}

.spese-table-head {
    padding: 0 .75rem .35rem .75rem;
    font-size: .85rem;
    font-weight: 700;
    color: var(--bs-secondary-color);
}

.spesa-mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.spese-actions {
    min-width: 96px;
}

@media (max-width: 991.98px) {
    .spese-table-row {
        grid-template-columns: 1fr;
    }
}

#speseCard .select2-container .select2-selection--single {
    height: calc(2.25rem + 2px);
    border: 1px solid #ced4da;
    border-radius: .375rem;
    padding: .375rem .75rem;
    display: flex;
    align-items: center;
}

#speseCard .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: normal;
    padding-left: 0;
    padding-right: 1.25rem;
}

#speseCard .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 100%;
    right: .5rem;
}

.incassi-table-head,
.incassi-table-row {
    display: grid;
    grid-template-columns: minmax(180px, 1.4fr) minmax(140px, 0.9fr) minmax(130px, 0.8fr) minmax(220px, 1.6fr) 110px;
    gap: 1rem;
    align-items: start;
}

.incassi-table-head {
    padding: 0 .25rem .5rem .25rem;
    border-bottom: 1px solid var(--bs-border-color);
    font-size: .875rem;
    font-weight: 600;
    color: var(--bs-secondary-color);
}

.incassi-table-row {
    align-items: start;
}

.incassi-actions {
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
}

@media (max-width: 991.98px) {
    .incassi-table-row {
        grid-template-columns: 1fr;
        gap: .75rem;
    }

    .incassi-actions {
        justify-content: stretch;
    }

        .incassi-actions .btn {
            width: 100%;
        }
}

.td-importi-summary .card,
.td-importi-summary .border {
    box-shadow: 0 .125rem .5rem rgba(0,0,0,.04);
}

@media (max-width: 767.98px) {
    .td-importi-summary .fs-4 {
        font-size: 1.5rem !important;
    }
}

.td-summary-card .card-body {
    padding: 1rem;
}

.td-economic-summary {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 1rem;
    align-items: stretch;
}

.td-economic-tile {
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
    padding: 1rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 1rem;
    background: var(--bs-body-bg);
    box-shadow: 0 .125rem .25rem rgba(0, 0, 0, .03);
}

.td-economic-tile__title {
    margin-bottom: .875rem;
    font-size: .95rem;
    font-weight: 600;
    color: var(--bs-heading-color);
    line-height: 1.2;
}

.td-economic-metrics {
    margin: 0;
}

.td-economic-metrics__row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .75rem;
    padding: .35rem 0;
    border-bottom: 1px dashed rgba(0, 0, 0, .08);
    align-items: center;
}

.td-economic-metrics__row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.td-economic-metrics__row dt {
    margin: 0;
    font-size: .875rem;
    font-weight: 500;
    color: var(--bs-secondary-color);
}

.td-economic-metrics__row dd {
    margin: 0;
    text-align: right;
    white-space: nowrap;
    font-weight: 600;
    color: var(--bs-body-color);
}

.td-economic-metrics__row--total {
    margin-top: .35rem;
    padding-top: .75rem;
    border-top: 1px solid var(--bs-border-color);
    border-bottom: 0;
}

.td-economic-metrics__row--total dt {
    font-weight: 600;
    color: var(--bs-heading-color);
}

.td-economic-metrics__row--total dd {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--bs-heading-color);
}

.td-economic-tile--grand-total {
    border-width: 2px;
    box-shadow: 0 .35rem 1rem rgba(0, 0, 0, .06);
    background: linear-gradient(180deg, rgba(13, 110, 253, .04) 0%, rgba(13, 110, 253, .01) 100%);
}

.td-economic-tile--grand-total .td-economic-tile__title {
    font-size: 1rem;
}

.td-economic-metrics__row--grand {
    margin-top: .5rem;
    padding-top: .875rem;
    border-top: 2px solid var(--bs-primary);
    border-bottom: 0;
}

.td-economic-metrics__row--grand dt {
    font-size: .75rem;
    font-weight: 700;
    color: var(--bs-heading-color);
}

.td-economic-metrics__row--grand dd {
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--bs-primary);
}

@media (max-width: 1399.98px) {
    .td-economic-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    .td-economic-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .td-summary-card .card-body {
        padding: .875rem;
    }

    .td-economic-summary {
        grid-template-columns: 1fr;
        gap: .75rem;
    }

    .td-economic-tile {
        padding: .875rem;
        border-radius: .875rem;
    }

    .td-economic-metrics__row dd {
        font-size: .95rem;
    }

    .td-economic-metrics__row--grand dd {
        font-size: 1.35rem;
    }
}

.td-detail-section {
    margin-bottom: 1rem;
    border: 1px solid var(--bs-border-color);
    overflow: hidden;
}

.td-detail-section__header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .9rem 1rem;
    background: var(--bs-body-bg);
    border: 0;
    text-align: left;
    appearance: none;
    -webkit-appearance: none;
    box-shadow: none;
}

.td-detail-section__header:hover {
    background: rgba(0, 0, 0, .02);
}

.td-detail-section__title-wrap {
    min-width: 0;
    flex: 1 1 auto;
}

.td-detail-section__title {
    font-size: .98rem;
    font-weight: 600;
    color: var(--bs-heading-color);
    line-height: 1.2;
}

.td-detail-section__meta {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1rem;
    margin-top: .35rem;
    font-size: .85rem;
    color: var(--bs-secondary-color);
}

    .td-detail-section__meta span {
        white-space: nowrap;
    }

.td-detail-section__chevron {
    flex: 0 0 auto;
    color: var(--bs-secondary-color);
    transition: transform .2s ease;
}

.td-detail-section__header:not(.collapsed) .td-detail-section__chevron {
    transform: rotate(180deg);
}

.td-detail-section .card-body {
    padding: 1rem;
    border-top: 1px solid var(--bs-border-color);
}

.td-inline-summary {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1.25rem;
    padding: .75rem .875rem;
    border: 1px solid var(--bs-border-color);
    border-radius: .75rem;
    background: rgba(0, 0, 0, .015);
    font-size: .9rem;
}

.td-inline-summary span {
    color: var(--bs-secondary-color);
}

.td-inline-summary strong {
    color: var(--bs-body-color);
    font-weight: 700;
    margin-left: .25rem;
}

.td-stato-picker {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
}

.td-stato-picker__btn {
    min-height: 52px;
    padding: .75rem 1rem;
    border-radius: .9rem;
    text-align: center;
    font-weight: 600;
}

.td-stato-picker__btn.is-selected {
    color: #fff;
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 .2rem rgba(13, 110, 253, .15);
}

@media (max-width: 575.98px) {
    .td-stato-picker {
        grid-template-columns: 1fr;
    }
}

/* AGENDA */

.agenda-page .card {
    border-radius: 1rem;
}

.agenda-grid {
    display: grid;
    grid-template-columns: 88px repeat(5, minmax(0, 1fr));
    gap: 1px;
    background: #d9dee5;
    border: 1px solid #d9dee5;
    border-radius: 1rem;
    overflow: hidden;
}

.agenda-grid__header,
.agenda-grid__time,
.agenda-grid__cell {
    min-width: 0;
    background: #fff;
}

.agenda-grid__header {
    min-height: 74px;
    padding: .875rem .75rem;
    background: #f8fafc;
}

.agenda-grid__header--time {
    background: #f8fafc;
}

.agenda-grid__header--today {
    background: #eef6ff;
}

.agenda-grid__dayname {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agenda-grid__daydate {
    margin-top: .25rem;
    font-size: .8125rem;
    color: #64748b;
}

.agenda-grid__time {
    min-height: 92px;
    padding: .875rem .5rem;
    font-size: .875rem;
    font-weight: 700;
    color: #64748b;
    background: #fbfcfe;
    border-right: 1px solid #eef2f7;
}

.agenda-grid__cell {
    min-height: 92px;
    padding: .75rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.agenda-grid__cell--today {
    background: #fcfdff;
}

.agenda-grid__empty {
    min-height: 100%;
}

.agenda-event {
    display: block;
    min-width: 0;
    max-width: 100%;
    text-decoration: none;
    color: inherit;
    border-radius: .9rem;
    padding: .75rem .8rem;
    border: 1px solid rgba(15, 23, 42, 0.04);
    box-shadow: 0 .12rem .35rem rgba(15, 23, 42, 0.04);
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
    overflow: hidden;
}

    .agenda-event:hover,
    .agenda-event:focus {
        transform: translateY(-1px);
        box-shadow: 0 .35rem .8rem rgba(15, 23, 42, 0.08);
        border-color: rgba(15, 23, 42, 0.08);
    }

.agenda-event__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .5rem;
}

.agenda-event__titleWrap {
    min-width: 0;
    flex: 1 1 auto;
}

.agenda-event__title {
    margin-top: .35rem;
    font-size: .9rem;
    font-weight: 700;
    line-height: 1.25;
    color: #0f172a;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.agenda-event__time {
    font-size: 0.7rem;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agenda-event__badge {
    flex: 0 0 auto;
    white-space: nowrap;
    font-size: 0.7rem;
    line-height: 1;
    padding: 0.3em;
    border-radius: 0.3rem;
    max-width: 111px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agenda-event__client {
    margin-top: .45rem;
    font-size: .8rem;
    font-weight: 500;
    line-height: 1.3;
    color: #0f172a;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.agenda-event__address {
    margin-top: .25rem;
    font-size: .84rem;
    line-height: 1.35;
    color: #334155;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.agenda-event__tech {
    margin-top: .3rem;
    font-size: .82rem;
    line-height: 1.3;
    color: #64748b;
    white-space: pre-wrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agenda-month__grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 1px;
    background: #dee2e6;
    border: 1px solid #dee2e6;
    border-radius: 1rem;
    overflow: hidden;
}

.agenda-month__head,
.agenda-month__cell {
    min-width: 0;
    background: #fff;
    padding: .75rem;
}

.agenda-month__head {
    background: #f8f9fa;
    font-weight: 600;
    min-height: 56px;
}

.agenda-month__cell {
    min-height: 150px;
    display: flex;
    flex-direction: column;
    gap: .375rem;
    overflow: hidden;
}

.agenda-month__cell--muted {
    background: #fbfbfb;
    color: #adb5bd;
}

.agenda-month__event {
    display: block;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    background: #f8f9fa;
    border-radius: .75rem;
    padding: .5rem .625rem;
    margin-bottom: .25rem;
    line-height: 1.25;
    transition: background-color .12s ease, box-shadow .12s ease;
}

.agenda-month__event:hover,
.agenda-month__event:focus {
    background: #eef2f6;
    box-shadow: 0 .15rem .45rem rgba(0,0,0,.06);
}

.agenda-month__event-time {
    display: block;
    font-size: .75rem;
    font-weight: 700;
    color: #0d6efd;
    margin-bottom: .125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agenda-month__event-title {
    display: block;
    font-size: .8125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agenda-month__daytop {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .5rem;
    margin-bottom: .25rem;
}

.agenda-month__daynum {
    font-weight: 700;
}

.agenda-month__weekday {
    font-size: .75rem;
    color: #6c757d;
    white-space: nowrap;
}

.agenda-month__empty {
    font-size: .8125rem;
    color: #6c757d;
}

.agenda-month__more {
    font-size: .75rem;
    color: #6c757d;
    margin-top: .125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agenda-mobile .card {
    border-radius: 1rem;
}

@media (max-width: 991.98px) {
    .agenda-page .h3 {
        font-size: 1.5rem;
    }
}

.link-vai-alla-scheda {
    display: inline-block;
    text-align: center;
    padding: 0px;
    padding-left: 5px;
    vertical-align: top;
}

.table-row-empty-for-printing{
    display:none;
    height:60px;
}

@media print {
    .td-body {
        background: #FFFFFF;
    }

    header {
        display: none;
    }

    footer {
        display: none;
    }

    .td-main {
        width: 100%;
        max-width: none;
        padding: 0px;
    }

    .d-none-print {
        display: none !important;
    }

    #dgMapCol {
        display: none;
    }

    #dgListCol {
        width: 100%;
    }

    .dropdown {
        display: none;
    }

    .table-responsive thead tr th {
        padding: 3px;
        font-size: 0.6em;
    }

    .table-responsive tbody tr td {
        padding: 0px 5px;
        font-size: 0.9em;
    }

    .table-responsive.trprint-assistenza tbody tr td {
        font-size: 1em;
    }

    .table-responsive.trprint-installazione tbody tr td {
        font-size: 0.8em;
    }
    
    .td-hasbar {
        padding: .5rem .5rem !important;
        padding-bottom: 20px !important;
    }

    .td-hasbar::before {
        top: auto;
        bottom: 5px;
        width: 100%;
        height: 15px;
    }

    .table-row-empty-for-printing {
        display: table-row!important;
    }

    .td-zone {
        display: none;
    }

    .print-col-data {
        width: 80px !important;
    }

    .print-col-cliente {
        width: 250px !important;
    }

    .print-col-descrizione {
        width: auto !important;
    }

    .print-col-stato {
        width: 100px !important;
    }

    .print-col-altro {
        display: none;
    }

    .td-status-responsive {
        flex-direction: row;
    }

    .td-desc .td-clamp-3 {
        display: block;
    }

    .print-keep-together {
        break-inside: avoid !important;
        page-break-inside: avoid !important;
        display: block;
    }

        .print-keep-together > .card,
        .print-keep-together > .table-responsive,
        .print-keep-together > .row {
            break-inside: avoid !important;
            page-break-inside: avoid !important;
        }

    .td-economic-summary {
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: 0.5rem !important;
    }

    .td-inline-summary {
        font-size: 0.8rem !important;
        padding: .5rem !important;
    }

    .td-economic-tile {
        padding: 0.3rem !important;
    }

    .td-economic-tile--grand-total .td-economic-tile__title,
    .td-economic-tile__title {
        font-size: .7rem !important;
        text-align: center !important;
        margin-bottom: .2rem !important;
    }

    .td-economic-metrics__row {
        display: block !important;
        text-align: center !important;
        padding: 0.1rem 0 !important;
    }

    .td-economic-metrics__row--total {
        padding: 0.1rem 0 !important;
    }

    .td-economic-metrics__row dt,
    .td-economic-metrics__row dd {
        font-size: .8rem;
        text-align: center;
    }

    .td-economic-metrics__row--grand {
        border-top: 1px solid var(--bs-primary);
    }

    #collapseFirme,
    #collapseManodopera,
    #collapseOrari,
    #collapseMateriali {
        display: block !important;
    }

    .table-responsive {
        display: block !important;
    }

    .print-orari-tecnici-resoconto {
        display: grid !important;
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }

    .print-manodopera-resoconto {
        display: grid !important;
        grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    }

        .print-manodopera-resoconto .col-md-6,
        .print-orari-tecnici-resoconto .col-md-6 {
            width: 100% !important;
        }

    .print-manodopera-resoconto .col-md-12 .p-3, .print-orari-tecnici-resoconto .col-md-12 .p-3 .print-manodopera-resoconto .col-md-6 .p-3, .print-orari-tecnici-resoconto .col-md-6 .p-3 {
        padding: 0.4rem 1rem !important;
        margin-top:5px!important;
    }

    .print-manodopera-resoconto .col-md-12 .p-3 .fs-4,
    .print-manodopera-resoconto .col-md-6 .p-3 .fs-5,
    .print-orari-tecnici-resoconto .col-md-12 .p-3 .fs-4,
    .print-orari-tecnici-resoconto .col-md-6 .p-3 .fs-5{
        font-size: 0.9rem !important;
    }

    .td-detail-section{
        margin:0px!important;
    }

    .td-detail-section__header {
        padding: .3rem!important;
    }

    .card-body {
        padding: 0.3rem !important;
    }

    .my-4 {
        margin-top: 0.5rem !important;
        margin-bottom: 0.5rem !important;
    }

    #collapseFirme .col-12{
        width:50%;
    }

    
}

.td-accesso-remove-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: calc(1.5em + .75rem + 2px);
    padding-left: .5rem;
    padding-right: .5rem;
}

[data-accesso-item] .form-label.small {
    font-size: .75rem;
    font-weight: 600;
    color: var(--bs-secondary-color);
    text-transform: uppercase;
    letter-spacing: .02em;
}

.kv-list.compact .kv-row {
    padding: .45rem 0;
}

    .kv-list.compact .kv-row dt {
        font-size: .85rem;
        color: var(--bs-secondary-color);
    }

    .kv-list.compact .kv-row dd {
        font-size: .95rem;
        font-weight: 500;
    }

.td-piano-box {
    border: 1px solid rgba(0,0,0,.08);
    border-radius: .9rem;
    padding: .85rem 1rem;
    background: var(--bs-body-bg);
}

.td-piano-box__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    margin-bottom: .75rem;
}

.td-piano-box__title {
    font-weight: 700;
    color: #212529;
}

.td-accessi-list {
    display: grid;
    gap: .45rem;
}

.td-accesso-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 64px 64px;
    gap: .75rem;
    align-items: center;
    padding: .0rem .65rem;
    border: 1px solid rgba(0,0,0,.06);
    border-radius: .75rem;
    background: #fff;
}

.td-accesso-row__desc {
    min-width: 0;
    font-weight: 500;
    word-break: break-word;
}

.td-accesso-row__qta {
    text-align: center;
}

.td-accesso-row__label {
    display: block;
    font-size: .72rem;
    color: var(--bs-secondary-color);
    text-transform: uppercase;
    letter-spacing: .03em;
    line-height: 1.1;
}

.td-accesso-row__value {
    display: block;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    margin-top: .1rem;
}

@media (max-width: 767.98px) {
    .td-piano-box {
        padding: .75rem;
    }

    .td-accesso-row {
        grid-template-columns: 1fr;
        gap: .35rem;
    }

    .td-accesso-row__qta {
        text-align: left;
        display: inline-flex;
        gap: .35rem;
        align-items: center;
    }

    .td-accesso-row__label,
    .td-accesso-row__value {
        display: inline;
    }
}

.td-route-box {
    margin: 12px;
    width: min(380px, calc(100vw - 24px));
    background: rgba(255, 255, 255, .98);
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 18px;
    box-shadow: 0 14px 32px rgba(15, 23, 42, .16);
    padding: 1rem;
}

.td-route-box__title {
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
    background: #64748b;
    color: #FFF;
    margin-bottom: .5rem;
    text-align: center;
    border-radius: 10px;
    padding: 5px;
}

.td-route-box__body {
    font-size: .95rem;
    color: #1f2937;
    line-height: 1.45;
}

.td-route-box__actions {
    margin-top: .9rem;
    display: flex;
    justify-content: flex-end;
    gap: .5rem;
    padding-top: .75rem;
    border-top: 1px solid rgba(15, 23, 42, .08);
}

.td-route-info {
    display: grid;
    gap: .75rem;
}

.td-route-info__eyebrow {
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
    color: #64748b;
}

.td-route-info__route {
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.35;
    color: #0f172a;
    word-break: break-word;
}

.td-route-info__route_indirizzo{
    font-size:0.9rem;
    font-weight:normal;
}

.td-route-info__arrow {
    color: #64748b;
    margin: 0 .2rem;
}

.td-route-info__stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
}

.td-route-info__stat {
    padding: .8rem .85rem;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, .06);
}

.td-route-info__stat-label {
    font-size: .78rem;
    color: #64748b;
    margin-bottom: .25rem;
    display: flex;
    align-items: center;
    gap: .2rem;
}

.td-route-info__stat-value {
    font-size: 1.1rem;
    font-weight: 800;
    color: #0f172a;
}

.td-route-info__hint {
    font-size: .85rem;
    color: #6b7280;
}

.td-route-info__error {
    font-size: .98rem;
    font-weight: 700;
    color: #b42318;
}

.td-route-box .btn {
    border-radius: 12px;
    font-weight: 600;
    padding: .45rem .8rem;
}

@media (max-width: 576px) {
    .td-route-box {
        width: calc(100vw - 24px);
        padding: .9rem;
        border-radius: 16px;
    }

    .td-route-info__route {
        font-size: 1rem;
    }

    .td-route-info__stats {
        grid-template-columns: 1fr;
    }

    .td-route-box__actions {
        justify-content: stretch;
    }

    .td-route-box__actions .btn {
        width: 100%;
    }
}

.td-summary-kpi {
    height: 100%;
    padding: 1rem 1.1rem;
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 .125rem .35rem rgba(0,0,0,.04);
}

.td-summary-kpi__label {
    font-size: .7rem;
    font-weight: 700;
    color: var(--bs-secondary-color);
    text-transform: uppercase;
    letter-spacing: .02em;
    margin-bottom: .45rem;
}

.td-summary-kpi__value {
    font-size: 1.3rem;
    font-weight: 800;
    line-height: 1.1;
    color: #0f172a;
}

.td-summary-kpi--total {
    background: linear-gradient(180deg, rgba(13,110,253,.10) 0%, rgba(13,110,253,.04) 100%);
    border-color: rgba(13,110,253,.22);
}

.td-summary-box {
    height: 100%;
    padding: 1rem 1.1rem;
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 1rem;
    background: #fff;
}

.td-summary-box--info {
    background: linear-gradient(180deg, rgba(25,135,84,.06) 0%, rgba(25,135,84,.02) 100%);
    border-color: rgba(25,135,84,.15);
}

.td-summary-box__title {
    font-size: .95rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: .85rem;
}

.td-summary-flow {
    display: flex;
    align-items: center;
    gap: .45rem;
    flex-wrap: wrap;
}

.td-summary-flow__item {
    padding: .45rem .7rem;
    border-radius: 999px;
    background: rgba(13,110,253,.08);
    border: 1px solid rgba(13,110,253,.14);
    font-size: .82rem;
    font-weight: 700;
    color: #0f172a;
}

.td-summary-flow__item--final {
    background: rgba(25,135,84,.10);
    border-color: rgba(25,135,84,.18);
}

.td-summary-flow__arrow {
    color: var(--bs-secondary-color);
    font-weight: 700;
}

@media (max-width: 767.98px) {
    .td-summary-kpi__value {
        font-size: 1.3rem;
    }

    .td-summary-box,
    .td-summary-kpi {
        padding: .9rem;
    }
}

.td-exclusion-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: .65rem;
}

@media (min-width: 768px) {
    .td-exclusion-grid {
        grid-template-columns: 1fr 1fr 1fr 1fr;
    }
}

/* Chip style: rende checkbox + label cliccabili e più belli */
.td-chip {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .3rem .6rem;
    border: 1px solid #dee2e6;
    background: #fff;
    cursor: pointer;
    user-select: none;
    min-height: 52px;
    border-radius: 1rem;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.td-chip:hover {
    box-shadow: 0 .2rem .6rem rgba(0,0,0,.06);
    transform: translateY(-1px);
}

.td-chip input {
    margin: 0;
}

.td-chip.is-checked {
    border-color: #0d6efd;
    background: rgba(13,110,253,.3);
}

.td-chip-address {
    width: 100%;
    justify-content: flex-start;
    text-align: left;
    white-space: normal;
    line-height: 1.35;
    padding: .75rem .9rem;
    border-radius: .85rem;
}

.td-chip-exclusion {
    width: 100%;
    justify-content: flex-start;
    text-align: left;
    white-space: normal;
    line-height: 1.35;
    min-height: 52px;
    padding: .7rem .9rem;
    border-radius: 1rem;
    border-color: rgba(0,0,0,.10);
    background: #fff;
}

.td-chip.td-chip-exclusion .form-check-input {
    flex: 0 0 auto;
    margin-top: 0;
}

.td-chip.td-chip-exclusion span {
    font-size: .95rem;
    font-weight: 500;
    line-height: 1.3;
    color: #212529;
}

.td-chip.td-chip-exclusion:hover {
    border-color: rgba(0,0,0,.18);
    background: #f8f9fa;
    box-shadow: 0 .2rem .6rem rgba(0,0,0,.06);
    transform: translateY(-1px);
}

.td-chip.td-chip-exclusion.is-checked {
    border-color: #0d6efd;
    background: rgba(13,110,253,.10);
    box-shadow: 0 0 0 .15rem rgba(13,110,253,.08);
}

.td-generate-menu {
    min-width: 320px;
    max-width: min(92vw, 420px);
    padding: .4rem;
    border-radius: 14px;
    box-shadow: 0 14px 30px rgba(0, 0, 0, .10);
}

.td-generate-menu__item {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    white-space: normal;
    line-height: 1.3;
    border-radius: 10px;
    padding: .7rem .8rem;
}

.td-generate-menu__item i {
    flex: 0 0 auto;
    margin-top: .1rem;
}

.td-generate-menu__item span {
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
}

@media (max-width: 575.98px) {
    .td-generate-menu {
        min-width: 0;
        width: min(92vw, 360px);
    }
}

.td-insertcustom-card {
    position: relative;
}

.td-insertcustom-actions-sticky {
    position: sticky;
    bottom: 0;
    z-index: 5;
    margin-top: 10px;
    background: linear-gradient( to top, var(--td-insertcustom-bg, rgba(246,247,251,1)) 65%, rgba(246,247,251,0) );
}

.td-insertcustom-actions-sticky__content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: 0.5rem 1rem;
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 1rem;
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(6px);
    box-shadow: 0 .35rem 1rem rgba(0,0,0,.08);
}

@media (max-width: 767.98px) {
    .td-insertcustom-actions-sticky__content {
        flex-direction: column;
        align-items: stretch;
    }

    .td-insertcustom-actions-sticky__content .btn {
        width: 100%;
    }
}

@media (min-width: 768px) {
    .td-insertcustom-actions-sticky__content .btn {
        min-width: 180px;
    }
}

[data-insertcustom-item].is-new {
    border-color: rgba(13,110,253,.45);
    box-shadow: 0 0 0 .2rem rgba(13,110,253,.10);
    transition: box-shadow .25s ease, border-color .25s ease;
}

.td-save-errors {
    position: sticky;
    top: 76px;
    z-index: 20;
}

.td-dayagenda-card {
    border-radius: 1rem;
    border: 1px solid rgba(0,0,0,.08);
    box-shadow: 0 .125rem .5rem rgba(0,0,0,.04);
}

.td-dayagenda-toolbar {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
    align-items: center;
    gap: 1rem;
}

.td-dayagenda-toolbar__title {
    min-width: 0;
}

.td-dayagenda-toolbar__center {
    text-align: center;
    padding: .25rem 0;
}

.td-dayagenda-toolbar__eyebrow {
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--bs-secondary-color);
    margin-bottom: .2rem;
}

.td-dayagenda-toolbar__date {
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1.2;
    color: #1f2a37;
    text-transform: capitalize;
}

.td-dayagenda-toolbar__count {
    margin-top: .45rem;
}

.td-dayagenda-toolbar__actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}

.td-dayagenda-toolbar__navbtn {
    width: 44px;
    height: 44px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: .85rem;
}

@media (max-width: 767.98px) {
    .td-dayagenda-toolbar {
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

    .td-dayagenda-toolbar__center {
        order: 2;
        text-align: center;
    }

    .td-dayagenda-toolbar__actions {
        order: 3;
        justify-content: space-between;
    }

    .td-dayagenda-toolbar__date {
        font-size: 1rem;
    }
}

.td-dayagenda-item {
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 1rem;
    box-shadow: 0 .125rem .5rem rgba(0,0,0,.04);
}

.td-dayagenda-item__top {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: .75rem;
    margin-bottom: .75rem;
}

.td-dayagenda-item__time {
    font-size: 1.15rem;
    font-weight: 800;
    min-width: 80px;
}

.td-dayagenda-item__meta {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1rem;
}

.td-dayagenda-item__actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: 1rem;
}

@media (max-width: 767.98px) {
    .td-dayagenda-item__top {
        flex-direction: row;
        align-items: center;
    }

    .td-dayagenda-item__actions .btn {
        flex: 1 1 auto;
    }
}

.td-dayagenda-item.is-now {
    border-color: rgba(13,110,253,.45);
    box-shadow: 0 0 0 .2rem rgba(13,110,253,.10);
}

.td-dayagenda-item.is-past {
    opacity: .65;
}

@media (min-width: 768px) {
    #filtersCollapse {
        display: block !important;
        height: auto !important;
        visibility: visible !important;
    }
}

@media (max-width: 575.98px) {
    .td-mobile-icon-actions {
        flex-direction: row !important;
        flex-wrap: nowrap;
    }

    .td-mobile-icon-actions > .btn,
    .td-mobile-icon-actions > .dropdown {
        flex: 1 1 0;
        width: auto !important;
        min-width: 0;
    }

    .td-mobile-icon-actions > .btn,
    .td-mobile-icon-actions > .dropdown > .btn {
        width: 100% !important;
        padding-inline: .75rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 0;
    }

        .td-mobile-icon-actions > .btn i,
        .td-mobile-icon-actions > .dropdown > .btn i {
            margin-right: 0 !important;
            font-size: 1.05rem;
        }

    .td-mobile-icon-actions > .dropdown > .dropdown-toggle::after {
        margin-left: .35rem;
        font-size: .8rem;
    }

    .td-mobile-icon-actions .dropdown-menu {
        min-width: 220px;
    }
}