/* =============================================================
   custom.css — sm2care (sm / Metronic)
   Classi utility generiche del progetto.
   Le variabili CSS e lo stile del tema vengono da style.bundle.css
   ============================================================= */

/* ---- Colori testo ---- */
.text-bold         { font-weight: bold !important; }
.text-giallo       { color: #FFC000 !important; }
.text-custom-green { color: var(--brand-success) !important; }
.text-purple       { color: #6f42c1 !important; }
.custom-blue       { color: var(--brand-primary); }
.custom-gray       { color: #868e96 !important; }
.custom-green      { color: var(--brand-success) !important; }
.icon-danger       { color: #dc3545 !important; }
.icon-white        { color: #fff !important; }
.force-svg-white   { filter: brightness(0) invert(1); }

/* ---- Sfondi ---- */
.bg-white { background-color: #fff !important; }

/* ---- Bordi ---- */
.border-bottom-0 { border-bottom: 0 !important; }

/* ---- Bottoni custom ---- */
.btn-custom-blue { background: var(--brand-primary); border-color: var(--brand-primary); color: white; }
.btn-custom-blue:hover,
.btn-custom-blue:focus,
.btn-custom-blue:active { background: var(--brand-primary-hover); border-color: var(--brand-primary-hover); color: white; }

.btn-custom-gray { background: #6c757d; border-color: #6c757d; color: white; }
.btn-custom-gray:hover,
.btn-custom-gray:focus,
.btn-custom-gray:active { background: #5a6268; border-color: #5a6268; color: white; }

.btn-custom-green { background: var(--brand-success); border-color: var(--brand-success); color: white; }
.btn-custom-green:hover,
.btn-custom-green:focus,
.btn-custom-green:active { background: var(--brand-success); border-color: var(--brand-success); color: white; }

.btn-custom-ocra { background: #c3a20e; border-color: #c3a20e; color: white; }
.btn-custom-ocra:hover,
.btn-custom-ocra:focus,
.btn-custom-ocra:active { background: #a17f0b; border-color: #a17f0b; color: white; }

.btn-custom-green-ossola { background: var(--brand-success); border-color: var(--brand-success); color: white; }
.btn-custom-green-ossola:hover,
.btn-custom-green-ossola:focus,
.btn-custom-green-ossola:active { background: var(--brand-success); border-color: var(--brand-success); color: white; }

/* ---- Outline bottoni custom ---- */
.btn-outline-custom-blue  { color: var(--brand-primary); border-color: var(--brand-primary); }
.btn-outline-custom-green { color: var(--brand-success); border-color: var(--brand-success); }
.btn-outline-arancione    { color: #c3a20e !important; border-color: #c3a20e !important; }
.btn-outline-gray         { color: #6c757d; border-color: #6c757d; }
.btn-outline-gray:hover,
.btn-outline-gray:focus,
.btn-outline-gray:active  { color: #5a6268; border-color: #5a6268; }
.btn-outline-custom-ocra  { color: #c3a20e; border-color: #c3a20e; }
.btn-outline-custom-ocra:hover,
.btn-outline-custom-ocra:focus,
.btn-outline-custom-ocra:active { color: #a17f0b; border-color: #a17f0b; }

/* ---- Stato disabled globale ---- */
.btn:disabled,
.btn.disabled,
fieldset:disabled .btn {
  background-color: #ccc !important;
  border-color: #ccc !important;
  color: #666 !important;
  cursor: not-allowed !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* ---- Righe tabella ---- */
.sm-row-totale td,

.row-error   { background: rgba(220, 53, 69, 0.08) !important; transition: background-color 0.2s ease; }
.row-warning { background-color: #fff3cd !important; transition: background-color 0.2s ease; }
.row-error input,
.row-error .form-control,
.row-error .form-select-sm { border-color: rgba(220, 53, 69, 0.55) !important; box-shadow: 0 0 0 .15rem rgba(220, 53, 69, 0.12); }
.row-error select           { border-color: rgba(220, 53, 69, 0.55) !important; box-shadow: 0 0 0 .15rem rgba(220, 53, 69, 0.12); }
.row-error .input-group-text { border-color: rgba(220, 53, 69, 0.55) !important; background-color: rgba(220, 53, 69, 0.08) !important; }

/* ---- Collapse card ---- */
.collapse-card             { overflow: hidden; transition: all 0.3s ease; }
.collapse-card:not(.show)  { height: 0; padding-top: 0; padding-bottom: 0; opacity: 0; }
.collapse-card.show        { height: auto; opacity: 1; }

/* ---- Accordion manuale ---- */
.accordion-content         { display: none; }
.accordion-content.show    { display: table-row; animation: fadeIn 0.3s ease-out; }
@keyframes fadeIn          { from { opacity: 0; } to { opacity: 1; } }
.accordion-toggle          { cursor: pointer; transition: background-color 0.2s ease; }
.accordion-toggle:hover    { background-color: rgba(37, 99, 235, 0.1) !important; }
.accordion-icon            { transition: transform 0.3s ease; margin-left: 10px; }
.accordion-icon.rotated    { transform: rotate(90deg); }

/* ---- Local suggest (autocomplete) ---- */
.local-suggest-menu  { position: absolute; z-index: 2000; top: 100%; left: 0; right: 0; max-height: 320px; overflow: auto; border: 1px solid rgba(0,0,0,.12); border-top: none; background: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.12); border-radius: 0 0 .5rem .5rem; }
.local-suggest-sec   { padding: .375rem .75rem; border-top: 1px solid rgba(0,0,0,.06); }
.local-suggest-sec:first-child { border-top: none; }
.local-suggest-title { font-size: .75rem; color: #6c757d; margin: .25rem 0; }
.local-suggest-item  { padding: .5rem .75rem; cursor: pointer; }
.local-suggest-item small { color: #6c757d; display: block; }
.local-suggest-item:hover,
.local-suggest-item.active { background: #f5f5f5; }
.local-suggest-empty { padding: .5rem .75rem; color: #9aa0a6; font-style: italic; }

/* ---- Select2 customizzazioni ---- */
.s2-option-wrapper { display: flex; align-items: center; justify-content: space-between; width: 100%; position: relative; }
.s2-tooltip        { display: none; position: absolute; right: -5px; top: 50%; transform: translateY(-50%); background: #333; color: #fff; padding: 4px 6px; border-radius: 4px; white-space: nowrap; font-size: 12px; z-index: 9999; }
.select2-results__option:hover .s2-tooltip { display: inline-block; }
.s2-disabled .s2-text { color: #999 !important; cursor: not-allowed; }

/* ---- Google Maps autocomplete ---- */
.pac-container { background-color: #FFF; z-index: 9999; position: fixed; display: inline-block; float: left; }

/* ---- Input monospace ---- */
.aru-input-code { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; letter-spacing: .2px; }

/* Altezza header ridotta */
:root {
    --kt-app-header-height: 70px !important;
    --kt-app-header-height-actual: 70px !important;
    --bs-app-header-height: 70px !important;
    --bs-app-header-height-actual: 70px !important;
}
body[data-kt-app-header-fixed="true"] {
    --kt-app-header-height: 70px !important;
}
#kt_app_header {
    min-height: 70px !important;
    height: 70px !important;
}
#kt_app_header .d-flex.flex-stack.flex-grow-1 {
    min-height: 70px !important;
    height: 70px !important;
}

/* Sidebar: allinea top al nuovo header */
#kt_app_sidebar {
    top: 70px !important;
    height: calc(100vh - 70px) !important;
}

/* Sidebar: stato attivo della voce corrente.
   Il menu è piatto: la classe `.active` viene messa lato server sul
   `.menu-link` di primo livello (vedi _sidebar.php). Le regole vanno quindi
   sul link attivo, non su una struttura `.menu-sub` (che qui non esiste). */
#kt_app_sidebar_menu .menu-item > .menu-link.active {
    background-color: var(--bs-primary-bg-subtle) !important;
    /* accento sinistro brand: box-shadow inset così non sposta il contenuto
       e segue l'arrotondamento della voce (menu-rounded) */
    box-shadow: inset 3px 0 0 0 var(--bs-primary) !important;
}
#kt_app_sidebar_menu .menu-item > .menu-link.active .menu-title {
    color: var(--bs-primary) !important;
    font-weight: 600;
}
#kt_app_sidebar_menu .menu-item > .menu-link.active .menu-icon,
#kt_app_sidebar_menu .menu-item > .menu-link.active .menu-icon i,
#kt_app_sidebar_menu .menu-item > .menu-link.active .menu-icon i:before {
    color: var(--bs-primary) !important;
}
/* Eventuali sotto-voci con bullet: bullet primario ingrandito */
#kt_app_sidebar_menu .menu-sub .menu-item.active > .menu-link.active .menu-bullet .bullet {
    background-color: var(--bs-primary) !important;
    transform: scale(1.4);
}

/* =======================================================================
   Sidebar — logo brand cliente + stato minimizzato
   ----------------------------------------------------------------------- */

/* Logo brand: contenitore non comprimibile, sempre a tutta larghezza */
#kt_app_sidebar_logo {
    flex: 0 0 auto;
}
.sm-sidebar-logo-default {
    height: 58px;
    width: auto;
    max-width: 100%;
    display: block;
}
.sm-sidebar-logo-minimize {
    height: 38px;
    width: auto;
    display: none;   /* mostrato solo a sidebar minimizzata (regole sotto) */
}

/* Sidebar minimizzata (non in hover): mostra il logo ridotto e centrato.
   Con hover attivo (sidebar che si riespande) torna il logo completo. */
[data-kt-app-sidebar-minimize="on"] .app-sidebar:not(:hover) #kt_app_sidebar_logo {
    padding-left: 0 !important;
    padding-right: 0 !important;
}
[data-kt-app-sidebar-minimize="on"] .app-sidebar:not(:hover) .sm-sidebar-logo-default {
    display: none;
}
[data-kt-app-sidebar-minimize="on"] .app-sidebar:not(:hover) .sm-sidebar-logo-minimize {
    display: block;
}

/* Menu minimizzato: icone perfettamente centrate nella colonna stretta */
[data-kt-app-sidebar-minimize="on"] .app-sidebar:not(:hover) #kt_app_sidebar_menu > .menu-item > .menu-link {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}
[data-kt-app-sidebar-minimize="on"] .app-sidebar:not(:hover) #kt_app_sidebar_menu > .menu-item > .menu-link .menu-icon {
    margin-right: 0;
    width: auto;
    justify-content: center;
}
/* Titolo voce: nel menu piatto Metronic non lo nasconde da solo a sidebar
   minimizzata, così il suo flex-grow tiene larga la voce e spinge l'icona a
   sinistra (icona scentrata + pillola attiva sbilanciata). Lo nascondiamo:
   le icone si centrano e l'evidenziazione attiva resta simmetrica. */
[data-kt-app-sidebar-minimize="on"] .app-sidebar:not(:hover) #kt_app_sidebar_menu > .menu-item > .menu-link .menu-title {
    display: none !important;
}

/* Voce attiva a sidebar minimizzata: con l'icona centrata l'accento sinistro
   resta incollato al bordo e sembra disallineato. Lo togliamo e lasciamo solo
   un riquadro arrotondato in tinta brand, centrato sull'icona. L'accento
   sinistro torna quando la sidebar si riespande in hover (regola base). */
[data-kt-app-sidebar-minimize="on"] .app-sidebar:not(:hover) #kt_app_sidebar_menu > .menu-item > .menu-link.active {
    box-shadow: none !important;
    border-radius: 0.475rem;
}

/* Respiro in fondo alla sidebar: l'ultima voce non resta incollata/tagliata */
#kt_app_sidebar_menu {
    padding-bottom: 1.75rem;
}
#kt_app_sidebar_wrapper {
    padding-bottom: 0.5rem;
}

/* ---- Dimensioni utili ---- */
.w200          { width: 200px !important; }
.max-width-100 { max-width: 100px !important; }
.min-width-70  { min-width: 70px !important; }
.min-width-100 { min-width: 100px !important; }
.min-width-120 { min-width: 120px !important; }
.min-width-150 { min-width: 170px !important; }
.min-width-170 { min-width: 170px !important; }
.min-width-200 { min-width: 200px !important; }
.max-width-200 { max-width: 200px !important; }
.min-width-250 { min-width: 270px !important; }
.max-width-250 { max-width: 270px !important; }
.max-width-350 { max-width: 370px !important; }
.min-height-34 { min-height: 34px !important; }
.min-height-48 { min-height: 48px !important; }
