@charset "UTF-8";

/*
 * Gestionale MC Giardini — foglio di stile MOBILE FIRST.
 * Le regole base valgono per smartphone; i @media min-width allargano per tablet e desktop.
 * Caricato dopo custom.css: sovrascrive solo ciò che serve al gestionale.
 */


/*** Layout base ***/

html {
    font-size: 15px;
}

.wrapper {
    min-height: calc(100vh - 220px);
}

.container-fluid {
    max-width: 100%;
    padding: 1rem;
}

.header_nav {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
}

.navbar-brand {
    margin-right: 0.5rem !important;
}

.navbar-brand img {
    height: 44px !important;
}

.header_nav .nav-link {
    padding: 0.7rem 0.5rem;
    font-size: 1.05rem;
}

.header_nav .dropdown-menu {
    border: none;
    box-shadow: 0 6px 18px -8px rgba(0,0,0,0.4);
}

.breadcrumb {
    font-size: 0.95rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    margin: 0;
    flex-wrap: wrap;
}


/*** Pulsanti: dimensione tap ***/

.btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border-radius: var(--border-radius);
    margin: 0.25rem 0;
}

.btn-sm {
    min-height: 38px;
    padding: 0.35rem 0.8rem;
}

.btn-block-mobile {
    width: 100%;
}

.form-control, .form-select {
    min-height: 44px;
    font-size: 1rem !important;
}

textarea.form-control {
    min-height: 90px;
}

.form-label {
    margin-bottom: 0.25rem;
    font-weight: 700;
    font-size: 0.9rem;
    color: #6b6b6b;
}

.form-group {
    margin-bottom: 0.9rem;
}

.card-header {
    max-height: none !important;
    background-color: #fff;
    border-bottom: 1px solid #ececec;
    font-size: 1rem;
}

.card {
    border: 1px solid #e6e6e6;
    border-radius: 10px;
    box-shadow: 0 2px 10px -6px rgba(0,0,0,0.25);
}


/*** Testata pagina ***/

.g-page-head {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.g-page-head h3, .g-page-head h5 {
    margin: 0;
    font-weight: 700;
}

.g-page-head .badge {
    font-size: 0.75rem;
    vertical-align: middle;
    background-color: var(--main);
}

.g-page-sub {
    color: #6b6b6b;
    font-size: 0.95rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.5rem;
    align-items: center;
}

.g-page-sub a {
    color: var(--main);
}

.g-sep {
    color: #c5c5c5;
}

.g-page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.g-page-actions .btn {
    flex: 1 1 auto;
}


/*** Barra di ricerca ***/

.g-search {
    margin-bottom: 1rem;
}

.g-search .input-group .form-control {
    border-radius: var(--border-radius) 0 0 var(--border-radius);
}

.g-search .input-group .btn {
    margin: 0;
    min-width: 52px;
}

.g-search-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    align-items: center;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #6b6b6b;
}

.g-search-options .form-select {
    width: auto;
    min-height: 36px;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}


/*** Card elenco (clienti, giardini, interventi) ***/

.g-card {
    display: flex;
    align-items: stretch;
    background-color: #fff;
    border: 1px solid #e6e6e6;
    border-radius: 10px;
    box-shadow: 0 2px 10px -6px rgba(0,0,0,0.25);
    cursor: pointer;
    height: 100%;
    overflow: hidden;
    transition: box-shadow 0.15s;
}

.g-card:active, .g-card:hover {
    box-shadow: 0 6px 16px -8px rgba(0,0,0,0.45);
}

.g-card-static {
    cursor: default;
    flex-direction: column;
}

.g-card-inactive {
    opacity: 0.6;
}

.g-card-body {
    flex: 1 1 auto;
    padding: 0.85rem 1rem;
    min-width: 0;
}

.g-card-arrow {
    display: flex;
    align-items: center;
    padding: 0 0.75rem;
    color: #b5b5b5;
    font-size: 1.2rem;
}

.g-card-title {
    font-weight: 700;
    font-size: 1.1rem;
    line-height: 1.3;
    color: var(--main_fonts_color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.g-card-title .bi {
    color: var(--main);
    font-size: 1.1rem;
}

.g-card-sub {
    color: #6b6b6b;
    font-size: 0.92rem;
    margin-top: 0.15rem;
}

.g-card-note {
    font-size: 0.9rem;
    color: #555;
    margin-top: 0.4rem;
    white-space: pre-line;
}

.g-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.9rem;
    margin-top: 0.4rem;
    font-size: 0.92rem;
    color: #555;
}

.g-card-meta a {
    color: var(--main);
}

.g-card-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.9rem;
    margin-top: 0.6rem;
    padding-top: 0.5rem;
    border-top: 1px dashed #ececec;
    font-size: 0.88rem;
    color: #6b6b6b;
}

.g-card-stats .bi {
    color: var(--main);
    margin-right: 0.15rem;
}

.g-card-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem 1rem 0.75rem 1rem;
}

.g-card-actions .btn {
    margin: 0;
    flex: 1 1 auto;
}

.g-card-actions .btn:last-child {
    flex: 0 0 auto;
}

.g-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: #8a8a8a;
    background-color: #fff;
    border: 1px dashed #d9d9d9;
    border-radius: 10px;
}

.g-empty .bi {
    font-size: 2.2rem;
    color: #c5c5c5;
    display: block;
    margin-bottom: 0.5rem;
}

.g-empty p {
    margin: 0;
    color: #8a8a8a;
}


/*** Box form inline (es. nuovo giardino) ***/

.g-form-box {
    background-color: #fff;
    border: 1px solid var(--main);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.g-form-title {
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.g-form-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.g-form-actions .btn {
    flex: 1 1 auto;
}


/*** Tab bootstrap: scorrevoli su mobile ***/

.nav-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
}

.nav-tabs .nav-item {
    flex: 0 0 auto;
}

.nav-tabs .nav-link {
    white-space: nowrap;
    color: #6b6b6b;
    padding: 0.7rem 0.9rem;
}

.nav-tabs .nav-link.active {
    color: var(--main);
    font-weight: 700;
    border-bottom: 2px solid var(--main);
}


/*** Tabelle: niente larghezza minima forzata ***/

.g-table, .g-table table {
    min-width: 0;
}


/*** Paginazione ***/

.pagination {
    margin: 0.5rem 0;
}

.impaginazione_clienti:empty, .impaginazione_interventi:empty {
    display: none;
}


/*** Menu: voce "Registra" evidenziata ***/

.header_nav .g-nav-cta {
    color: var(--main) !important;
    font-weight: 700;
}


/*** Card intervento: riquadro data ***/

.g-card-date {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    padding: 0.5rem 0.25rem;
    background-color: var(--main);
    color: #fff;
    line-height: 1;
}

.g-card-day {
    font-size: 1.5rem;
    font-weight: 700;
}

.g-card-month {
    font-size: 0.8rem;
    text-transform: uppercase;
    margin-top: 0.2rem;
}

.g-date-sm {
    width: auto;
    min-height: 36px;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}


/*** Registratore vocale ***/

.g-card-ai {
    border-color: var(--main);
}

.g-recorder {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.g-mic {
    flex: 0 0 auto;
    width: 84px;
    height: 84px;
    border-radius: 50%;
    border: none;
    background-color: var(--main);
    color: #fff;
    font-size: 2.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px -6px rgba(0,0,0,0.5);
    cursor: pointer;
    transition: transform 0.1s, background-color 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.g-mic:active {
    transform: scale(0.95);
}

.g-mic:disabled {
    background-color: #cacaca;
    box-shadow: none;
}

.g-mic.recording {
    background-color: var(--warning);
    animation: g-pulse 1.4s infinite;
}

@keyframes g-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(255,0,0,0.45); }
    70%  { box-shadow: 0 0 0 18px rgba(255,0,0,0); }
    100% { box-shadow: 0 0 0 0 rgba(255,0,0,0); }
}

.g-recorder-info {
    flex: 1 1 auto;
    min-width: 0;
}

.g-recorder-timer {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.g-recorder-timer.recording {
    color: var(--warning);
}

.g-recorder-status {
    font-weight: 700;
    margin-top: 0.25rem;
}

.g-recorder-hint {
    font-size: 0.88rem;
    color: #6b6b6b;
    margin-top: 0.25rem;
}

.g-transcript {
    background-color: #f4f9ee;
    border-left: 4px solid var(--main);
    border-radius: 0 10px 10px 0;
    padding: 0.85rem 1rem;
    margin: 1rem 0;
}

.g-transcript-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--main);
    text-transform: uppercase;
}

.g-transcript-text {
    font-style: italic;
    margin-top: 0.25rem;
    white-space: pre-line;
}

.g-transcript-note {
    font-size: 0.88rem;
    color: #6b6b6b;
    margin-top: 0.5rem;
}

.g-ai-filled {
    border-color: var(--success) !important;
    box-shadow: 0 0 0 3px rgba(0,176,80,0.18) !important;
    transition: box-shadow 0.4s, border-color 0.4s;
}


/*** Selezione cliente nel form intervento ***/

.g-cliente-selected {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    background-color: #f4f9ee;
    border: 1px solid var(--main);
    border-radius: var(--border-radius);
    padding: 0.5rem 0.75rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.g-cliente-selected .btn {
    margin: 0;
    flex: 0 0 auto;
}

.g-cliente-selected .bi-person-check {
    color: var(--main);
}

.g-candidates {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.g-candidates-title {
    width: 100%;
    font-size: 0.95rem;
}

.g-candidates .btn {
    margin: 0;
    flex: 1 1 100%;
    justify-content: flex-start;
}


/*** Galleria foto ***/

.g-photo-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
    margin-top: 0.75rem;
}

.g-photo {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f2f2f2;
    aspect-ratio: 1 / 1;
}

.g-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.g-photo-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0.3rem 0.5rem;
    font-size: 0.75rem;
    color: #fff;
    background: linear-gradient(transparent, rgba(0,0,0,0.65));
}

.g-photo-actions {
    position: absolute;
    top: 0.35rem;
    right: 0.35rem;
    display: flex;
    gap: 0.3rem;
}

.g-photo-delete, .g-photo-link {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background-color: rgba(0,0,0,0.55);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    cursor: pointer;
}

.g-photo-simula {
    background-color: var(--main);
}

.g-empty-sm {
    padding: 1.25rem 1rem;
    grid-column: 1 / -1;
}

.g-empty-sm .bi {
    font-size: 1.6rem;
}


/*** Azioni form incollate in basso su mobile ***/

.g-form-actions-sticky {
    position: sticky;
    bottom: 0;
    background-color: rgba(255,255,255,0.95);
    padding: 0.6rem 0;
    margin: 0 -1rem;
    padding-left: 1rem;
    padding-right: 1rem;
    border-top: 1px solid #e6e6e6;
    z-index: 5;
}


/*** Dashboard: azioni rapide ***/

.g-quick {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.g-quick-main {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 12px;
    background-color: var(--main);
    color: #fff !important;
    box-shadow: 0 8px 20px -10px rgba(0,0,0,0.6);
}

.g-quick-main:active {
    transform: scale(0.99);
}

.g-quick-main b {
    display: block;
    font-size: 1.2rem;
}

.g-quick-main small {
    display: block;
    opacity: 0.9;
    font-size: 0.9rem;
}

.g-quick-mic {
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
}

.g-quick-search .input-group-text {
    background-color: #fff;
}

.g-quick-links {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.g-quick-links .btn {
    margin: 0;
    flex-direction: column;
    gap: 0.15rem;
    font-size: 0.85rem;
    padding: 0.5rem 0.25rem;
    background-color: #fff;
}

.g-quick-links .btn .bi {
    font-size: 1.3rem;
    color: var(--main);
}


/*** Dashboard: contatori ***/

.g-kpi {
    display: block;
    height: 100%;
    padding: 0.85rem 1rem;
    background-color: #fff;
    border: 1px solid #e6e6e6;
    border-radius: 10px;
    box-shadow: 0 2px 10px -6px rgba(0,0,0,0.25);
}

.g-kpi-label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #8a8a8a;
}

.g-kpi-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--main_fonts_color);
    font-variant-numeric: tabular-nums;
}

.g-kpi-sub {
    font-size: 0.85rem;
    color: #8a8a8a;
}

.g-kpi-alert {
    border-color: var(--waiting);
    background-color: #fff8ec;
}

.g-kpi-alert .g-kpi-value {
    color: var(--waiting);
}


/*** Dashboard: barre ore ***/

.g-bars {
    display: flex;
    align-items: stretch;
    gap: 0.4rem;
    height: 150px;
}

.g-bar {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
}

.g-bar-value {
    font-size: 0.75rem;
    color: #6b6b6b;
    height: 1.1rem;
    font-variant-numeric: tabular-nums;
}

.g-bar-track {
    flex: 1 1 auto;
    width: 100%;
    max-width: 38px;
    display: flex;
    align-items: flex-end;
    background-color: #f3f3f3;
    border-radius: 6px;
    overflow: hidden;
}

.g-bar-fill {
    width: 100%;
    background-color: #a9cf84;
    border-radius: 6px 6px 0 0;
    min-height: 0;
}

.g-bar-today .g-bar-fill {
    background-color: var(--main);
}

.g-bar-label {
    font-size: 0.78rem;
    color: #8a8a8a;
    margin-top: 0.3rem;
    text-transform: capitalize;
}

.g-bar-today .g-bar-label {
    color: var(--main);
    font-weight: 700;
}


/*** Scelte a "chip" (checkbox / radio) ***/

.g-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.g-chip {
    position: relative;
    cursor: pointer;
    margin: 0;
}

.g-chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.g-chip span {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0.4rem 0.9rem;
    border: 1px solid #d5d5d5;
    border-radius: 999px;
    background-color: #fff;
    font-size: 0.95rem;
    transition: background-color 0.15s, border-color 0.15s;
    user-select: none;
}

.g-chip input:checked + span {
    background-color: var(--main);
    border-color: var(--main);
    color: #fff;
}

.g-chip input:focus-visible + span {
    outline: 2px solid var(--main);
    outline-offset: 2px;
}


/*** Simulazioni: scelta foto ***/

.g-photo-pick {
    display: block;
    position: relative;
    width: 100%;
    border: 2px dashed #cfcfcf;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    background-color: #fafafa;
}

.g-photo-pick input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.g-photo-pick img {
    display: block;
    width: 100%;
    max-height: 45vh;
    object-fit: contain;
    background-color: #000;
}

.g-photo-pick-change {
    position: absolute;
    left: 50%;
    bottom: 0.6rem;
    transform: translateX(-50%);
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    background-color: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
    pointer-events: none;
}

.g-photo-pick-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 200px;
    color: #8a8a8a;
    font-weight: 700;
}

.g-photo-pick-empty .bi {
    font-size: 2.6rem;
    color: var(--main);
}


/*** Simulazioni: visore prima/dopo ***/

.g-sim-toggle .btn {
    margin: 0;
}

.g-sim-toggle .btn.active {
    background-color: var(--main);
    border-color: var(--main);
    color: #fff;
}

.g-sim-viewer {
    position: relative;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    background-color: #111;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.g-sim-viewer img {
    display: block;
    width: 100%;
    max-height: 75vh;
    object-fit: contain;
}

.g-sim-viewer .g-sim-before {
    position: absolute;
    inset: 0;
    height: 100%;
    opacity: 0;
    transition: opacity 0.25s;
    background-color: #111;
}

.g-sim-viewer.show-before .g-sim-before {
    opacity: 1;
}

.g-sim-badge {
    position: absolute;
    top: 0.6rem;
    left: 0.6rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
    background-color: rgba(0,0,0,0.55);
}

.g-sim-badge-after {
    background-color: var(--main);
}

.g-sim-badge-before {
    display: none;
}

.g-sim-viewer.show-before .g-sim-badge-before {
    display: inline-block;
}

.g-sim-viewer.show-before .g-sim-badge-after {
    display: none;
}

.g-sim-actions {
    display: flex;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.g-sim-actions .btn {
    flex: 1 1 auto;
}

.g-disclaimer {
    font-size: 0.8rem;
    color: #8a8a8a;
    font-style: italic;
    margin: 0.75rem 0;
}

/* Banner costo della generazione */
.g-costo {
    background-color: #f4f9ee;
    border: 0;
    border-left: 4px solid var(--main);
    border-radius: 0 10px 10px 0;
    padding: 0.75rem 3rem 0.75rem 1rem;
    margin: 0 0 0.75rem 0;
}

.g-costo-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--main);
    text-transform: uppercase;
}

.g-costo-value {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.3;
}

.g-costo-note {
    font-size: 0.8rem;
    color: #6b6b6b;
}

/* Riepilogo delle indicazioni da rileggere prima di generare */
.g-conferma-intro {
    color: #6b6b6b;
    margin-bottom: 1rem;
}

.g-conferma-block {
    margin-bottom: 1rem;
}

.g-conferma-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--main);
    text-transform: uppercase;
    margin-bottom: 0.35rem;
}

.g-conferma-list {
    padding-left: 1.4rem;
    margin: 0;
}

.g-conferma-list li {
    font-size: 1.05rem;
    line-height: 1.4;
    padding: 0.3rem 0;
}

.g-conferma-list-muted li {
    font-size: 0.95rem;
    color: #6b6b6b;
    padding: 0.1rem 0;
}

.g-conferma-dubbi {
    background-color: #fff8e6;
    border-left: 4px solid #f0ad00;
    border-radius: 0 10px 10px 0;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.g-conferma-dubbi .g-conferma-label {
    color: #8a6100;
}

.g-conferma-scritto {
    font-size: 0.85rem;
    color: #8a8a8a;
    margin-bottom: 0.5rem;
}

.g-conferma-correggi {
    border-top: 1px solid #e5e5e5;
    padding-top: 1rem;
    margin-top: 1rem;
}

.g-conferma-actions {
    flex-wrap: nowrap;
}

.g-conferma-actions .btn {
    flex: 1 1 0;
}

.g-conferma-actions .btn-primary {
    flex-grow: 2;
}

/* Dettatura in un campo di testo (pulsante "Detta" sotto la textarea) */
.g-dettatura {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.g-dettatura-btn {
    flex: 0 0 auto;
    min-width: 110px;
    min-height: 44px;
    border: 2px solid var(--main);
    border-radius: 999px;
    background-color: #fff;
    color: var(--main);
    font-weight: 700;
}

.g-dettatura-btn:hover,
.g-dettatura-btn:focus {
    background-color: #f4f9ee;
    border-color: var(--main);
    color: var(--main);
}

.g-dettatura-btn.recording,
.g-dettatura-btn.recording:hover {
    background-color: var(--warning);
    border-color: var(--warning);
    color: #fff;
}

.g-dettatura-btn:disabled {
    opacity: 1;
    color: var(--main);
    border-color: var(--main);
}

.g-dettatura-status {
    font-size: 0.85rem;
    color: #6b6b6b;
    line-height: 1.3;
}

/* Indicazioni confermate nel dettaglio simulazione */
.g-istruzioni {
    font-style: normal;
    white-space: normal;
}

.g-istruzioni ol {
    padding-left: 1.3rem;
    margin: 0;
}

.g-istruzioni-invariato {
    font-size: 0.88rem;
    color: #6b6b6b;
    margin-top: 0.35rem;
}

.g-istruzioni-storia {
    font-size: 0.85rem;
    color: #6b6b6b;
    border-top: 1px solid #dfe9d3;
    margin-top: 0.6rem;
    padding-top: 0.5rem;
}

.g-istruzioni-storia div {
    margin-bottom: 0.2rem;
}

.g-istruzioni-storia b {
    color: #4d4d4d;
}


/*** Simulazioni: card elenco ***/

.g-sim-card {
    cursor: pointer;
}

.g-sim-thumbs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    background-color: #e6e6e6;
}

.g-sim-thumbs img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
}


/*** Barra di navigazione inferiore (mobile) ***/

/* Spazio in fondo alla pagina per non coprire i contenuti con la barra */
body {
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
}

/* Con la barra inferiore il menu hamburger in alto non serve */
.header_nav .navbar-toggler {
    display: none;
}

.g-mnav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    display: flex;
    align-items: stretch;
    height: calc(64px + env(safe-area-inset-bottom, 0px));
    padding: 0 0.25rem env(safe-area-inset-bottom, 0px) 0.25rem;
    background-color: #fff;
    border-top: 1px solid #e6e6e6;
    box-shadow: 0 -4px 16px -8px rgba(0,0,0,0.25);
}

.g-mnav-item {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    padding: 0.35rem 0.15rem;
    border: none;
    background: transparent;
    color: #8a8a8a;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.g-mnav-item .bi {
    font-size: 1.45rem;
    line-height: 1;
}

.g-mnav-item span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.g-mnav-item.active,
.g-mnav-item:active {
    color: var(--main);
}

/* Voce centrale "Registra": pulsante tondo rialzato */
.g-mnav-cta {
    color: var(--main);
}

.g-mnav-mic {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin-top: -22px;
    border-radius: 50%;
    background-color: var(--main);
    color: #fff;
    box-shadow: 0 6px 16px -6px rgba(0,0,0,0.55), 0 0 0 4px #fff;
    transition: transform 0.1s;
}

.g-mnav-mic .bi {
    font-size: 1.5rem;
    color: #fff;
}

.g-mnav-cta:active .g-mnav-mic {
    transform: scale(0.94);
}

/* Foglio "Altro" */
.g-mnav-sheet {
    height: auto;
    max-height: 80vh;
    border-radius: 16px 16px 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.g-mnav-sheet .offcanvas-header {
    padding: 1rem 1.25rem 0.5rem 1.25rem;
}

.g-mnav-sheet .offcanvas-title {
    font-weight: 700;
    display: flex;
    align-items: center;
}

.g-mnav-sheet .offcanvas-title .bi {
    color: var(--main);
    font-size: 1.4rem;
}

.g-mnav-sheet .offcanvas-body {
    padding: 0.5rem 0.75rem 1rem 0.75rem;
}

.g-mnav-sheet-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #8a8a8a;
    padding: 0.9rem 0.5rem 0.25rem 0.5rem;
}

.g-mnav-sheet-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 48px;
    padding: 0.6rem 0.5rem;
    border-radius: 10px;
    color: var(--main_fonts_color);
    font-size: 1.05rem;
    text-decoration: none;
    cursor: pointer;
}

.g-mnav-sheet-item .bi {
    color: var(--main);
    font-size: 1.25rem;
    width: 1.6rem;
    text-align: center;
}

.g-mnav-sheet-item:active {
    background-color: #f4f9ee;
    color: var(--main);
}

/* Le azioni form incollate in basso restano sopra la barra */
.g-form-actions-sticky {
    bottom: calc(64px + env(safe-area-inset-bottom, 0px));
}


/*** Accordion (elenco clienti, simulazioni per cliente) ***/

.g-accordion .accordion-item {
    border: 1px solid #e6e6e6;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.6rem;
}

.g-accordion .accordion-button {
    min-height: 52px;
    padding: 0.7rem 1rem;
    font-weight: 700;
    color: var(--main_fonts_color);
    background-color: #fff;
    box-shadow: none;
    gap: 0.5rem;
}

.g-accordion .accordion-button:not(.collapsed) {
    color: var(--main);
    background-color: #f4f9ee;
}

.g-accordion .accordion-button:focus {
    box-shadow: none;
    border-color: transparent;
}

.g-accordion .accordion-button::after {
    margin-left: 0.5rem;
}

.g-accordion .g-acc-title {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.g-accordion .g-acc-title .bi {
    color: var(--main);
    margin-right: 0.25rem;
}

.g-accordion .accordion-button .badge {
    background-color: var(--main);
    font-size: 0.75rem;
}

.g-accordion .accordion-body {
    padding: 0.75rem;
    background-color: #fafafa;
}

.g-acc-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.5rem;
}

.g-acc-actions .btn {
    margin: 0;
}

/* Voce disattivata (clienti disattivati) */
.g-acc-inactive .accordion-button {
    opacity: 0.6;
}

/* Intestazione cliente: nome + riga dati */
.g-acc-head {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.g-acc-sub {
    display: flex;
    flex-wrap: wrap;
    gap: 0.15rem 0.8rem;
    font-size: 0.85rem;
    font-weight: 400;
    color: #6b6b6b;
}

.g-acc-sub .bi {
    color: var(--main);
    margin-right: 0.1rem;
}

.g-acc-loading {
    color: #8a8a8a;
    font-size: 0.9rem;
    padding: 0.25rem 0;
}

/* Riepilogo cliente */
.g-acc-actions-cliente {
    justify-content: stretch;
    gap: 0.5rem;
}

.g-acc-actions-cliente .btn {
    flex: 1 1 0;
    background-color: #fff;
}

.g-acc-actions-cliente .btn-primary {
    background-color: var(--main);
}

.g-acc-section {
    margin-top: 0.85rem;
}

.g-acc-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #8a8a8a;
    margin-bottom: 0.35rem;
}

.g-acc-section-title a {
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
    color: var(--main);
    margin-left: 0.25rem;
}

.g-acc-contacts {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.g-acc-contacts a, .g-acc-contacts span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 36px;
    color: var(--main_fonts_color);
    text-decoration: none;
    word-break: break-word;
}

.g-acc-contacts .bi {
    color: var(--main);
}

.g-acc-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.g-acc-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.7rem;
    border: 1px solid #d5d5d5;
    border-radius: 999px;
    background-color: #fff;
    font-size: 0.9rem;
}

.g-acc-tag .bi {
    color: var(--main);
}

.g-acc-list {
    display: flex;
    flex-direction: column;
    background-color: #fff;
    border: 1px solid #e6e6e6;
    border-radius: 8px;
    overflow: hidden;
}

.g-acc-list-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 44px;
    padding: 0.45rem 0.75rem;
    color: var(--main_fonts_color);
    text-decoration: none;
    font-size: 0.92rem;
}

.g-acc-list-item + .g-acc-list-item {
    border-top: 1px solid #f0f0f0;
}

.g-acc-list-date {
    flex: 0 0 auto;
    color: var(--main);
    font-weight: 700;
    font-size: 0.85rem;
}

.g-acc-list-text {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.g-acc-list-meta {
    flex: 0 0 auto;
    color: #8a8a8a;
    font-size: 0.85rem;
}

.g-acc-thumbs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.4rem;
}

.g-acc-thumbs img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 6px;
}

.g-acc-none {
    color: #8a8a8a;
    font-size: 0.9rem;
}


/*** Dialog jQuery UI: adattate al telefono ***/

@media screen and (max-width: 767px) {

    .ui-dialog {
        min-width: 0 !important;
        width: 94vw !important;
        max-width: 94vw !important;
        left: 3vw !important;
    }

    .ui-dialog .ui-dialog-buttonset button {
        min-height: 42px;
    }
}


/*** Tablet ***/

@media screen and (min-width: 768px) {

    .container-fluid {
        padding: 1.25rem 1.5rem;
    }

    .header_nav {
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
    }

    .g-page-head {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .g-page-actions .btn {
        flex: 0 0 auto;
    }

    .btn-block-mobile {
        width: auto;
    }

    .g-form-actions {
        justify-content: flex-end;
    }

    .g-form-actions .btn {
        flex: 0 0 auto;
    }

    .g-form-actions-sticky {
        position: static;
        margin: 0;
        padding: 0.5rem 0;
        border-top: none;
        background: transparent;
    }

    .g-candidates .btn {
        flex: 0 0 auto;
    }

    .g-photo-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .g-quick {
        display: grid;
        grid-template-columns: 1fr 1fr;
        align-items: stretch;
    }

    .g-quick-main {
        grid-row: span 2;
    }

    .g-quick-links .btn {
        flex-direction: row;
        font-size: 0.95rem;
    }

    .g-quick-links .btn .bi {
        font-size: 1.05rem;
    }

    .g-sim-actions .btn {
        flex: 0 0 auto;
    }

    .g-sim-toggle {
        max-width: 360px;
    }
}


/*** Desktop ***/

@media screen and (min-width: 992px) {

    html {
        font-size: 14px;
    }

    body {
        padding-bottom: 0;
    }

    .g-mnav {
        display: none;
    }

    .g-form-actions-sticky {
        bottom: auto;
    }

    .container-fluid {
        padding: 1.5rem 2.5rem;
    }

    .header_nav {
        padding-left: 3rem !important;
        padding-right: 3rem !important;
    }

    .navbar-brand img {
        height: 60px !important;
    }

    .navbar-brand {
        margin-right: 2rem !important;
    }

    .g-photo-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media screen and (min-width: 1400px) {

    .container-fluid {
        max-width: 1400px;
        margin-left: auto;
        margin-right: auto;
    }
}
