/* ==========================================================================
   preventivo.css
   Stili per /new-preventivo/ — Bootstrap 4 nativo.
   Contiene solo override minimi; il layout è gestito dalle classi Bootstrap.
   ========================================================================== */


/* --------------------------------------------------------------------------
   Pagina
   -------------------------------------------------------------------------- */

.preventivo-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}


/* --------------------------------------------------------------------------
   Sezioni del form (card Bootstrap)
   Ogni sezione occupa una colonna col-xl-3.
   -------------------------------------------------------------------------- */

.sezione-card {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.sezione-card .card-header {
    background-color: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
    padding: 0.5rem 0.75rem;
}

.sezione-card .card-body {
    padding: 0.75rem 0.875rem;
}


/* --------------------------------------------------------------------------
   Campi form
   -------------------------------------------------------------------------- */

.form-group.campo-div {
    margin-bottom: 0.625rem;
}

.form-group.campo-div > label {
    margin-bottom: 0.2rem;
    color: #495057;
}

.form-group.campo-div > input {
    width: 100%;
}


/* --------------------------------------------------------------------------
   Stato di errore — campo con valore non valido
   -------------------------------------------------------------------------- */

.form-control.error,
select.error,
input.error {
    border-color: #dc3545 !important;
    background-color: #fff8f8 !important;
    color: #212529 !important;
}

*:disabled.error {
    border: 2px inset;
}


/* --------------------------------------------------------------------------
   Sidebar prezzi — sticky su schermi grandi
   -------------------------------------------------------------------------- */

.sidebar-preventivo {
    position: sticky;
    top: 1rem;
    margin-left: 6rem;
}

#prezzo {
    border-bottom: none;
}

.preventivo-prezzo-tabella {
    width: 100%;
    font-size: 0.95rem;
}

.preventivo-prezzo-tabella td:last-child {
    padding-left: 0.25rem;
    color: #6c757d;
    font-size: 0.8rem;
}

#prezzo-unitario,
#dorso {
    font-weight: 700;
    color: #0d6efd;
    text-align: right;
    min-width: 4rem;
}


/* --------------------------------------------------------------------------
   Pulsanti salva / svuota
   Dimensioni base e colori delle varianti (.btn-primary / .btn-outline-*)
   sono gestiti da bootstrap-bridge.css. Qui solo il layout della barra e
   la spaziatura specifica di questi due pulsanti.
   -------------------------------------------------------------------------- */

#buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    padding: 0.75rem 1rem;
    border-top: 1px solid #dee2e6;
    background-color: #f8f9fa;
}

#buttons button {
    padding: 0.4rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
}


/* --------------------------------------------------------------------------
   Notifiche JS (#notify)
   -------------------------------------------------------------------------- */

#notify {
    min-height: 30px;
}

#notify > #notice {
    text-align: center;
}

#notify .errors {
    color: #dc3545;
    font-weight: 600;
}

#notify .alert-np {
    color: #fd7e14;
}


/* --------------------------------------------------------------------------
   Select profilo
   -------------------------------------------------------------------------- */

.select-profilo-div {
    max-width: 400px;
}


/* --------------------------------------------------------------------------
   Classi di visibilità usate dai listener JS
   -------------------------------------------------------------------------- */

.hide,
[class*="hide-"] {
    display: none !important;
}


/* --------------------------------------------------------------------------
   Select2 — allineamento Bootstrap 4
   -------------------------------------------------------------------------- */

.select2-container .select2-selection--single {
    height: calc(1.5em + 0.5rem + 2px);
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
    border: 1px solid #ced4da;
    border-radius: 0.2rem;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 1.5;
    padding-left: 0;
    color: #495057;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: calc(1.5em + 0.5rem + 2px);
}

.select2-selection.select2-selection--multiple {
    min-height: 70px;
    border: 1px solid #ced4da;
    border-radius: 0.2rem;
    background-color: #fff;
}

.select2-container--default.error .select2-selection {
    border-color: #dc3545 !important;
}


/* --------------------------------------------------------------------------
   Icone fontello
   -------------------------------------------------------------------------- */

.icon-prev {
    font-family: "fontello";
    font-style: normal;
    font-weight: normal;
    speak: none;
    display: inline-block;
    text-decoration: inherit;
    width: 1em;
    margin-right: 0.3em;
    text-align: center;
    font-variant: normal;
    text-transform: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}


/* --------------------------------------------------------------------------
   Tooltip qTip
   -------------------------------------------------------------------------- */

.qtip-content {
    font-size: 13px;
}


/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 767px) {
    .preventivo-title {
        font-size: 1.25rem;
    }

    .sidebar-preventivo {
        position: static;
        margin-top: 1.5rem;
    }
}
