/* =============================================================
   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; }
.sm-br-white     { border-right: 1px solid white !important; }
.sm-bl-white     { border-left: 1px solid white !important; }
.sm-bb-1         { border-bottom: 1px; }

/* ---- Border radius tabelle (legacy) ---- */
.sm-btl-20 { border-top-left-radius: 20px !important; border-bottom: 1px; }
.sm-btr-20 { border-top-right-radius: 20px !important; border-bottom: 1px; }

/* ---- 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,
.sm-row-totale th  { background: #e5e5e5 !important; }
.sm-row-totale td  { color: #333; border-top: 2px solid #d0d0d0 !important; }

.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; }

/* ---- Sezioni e card UI ---- */
.sm-section-title { color: var(--brand-primary); font-weight: 700; }
.sm-card-soft     { border: 1px solid rgba(0,0,0,.06); border-radius: 18px; box-shadow: 0 10px 26px rgba(0,0,0,.06); }

/* ---- 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 sub-menu: stato attivo minimale */
#kt_app_sidebar_menu .menu-sub .menu-item.active > .menu-link.active {
    background-color: transparent !important;
}
#kt_app_sidebar_menu .menu-sub .menu-item.active > .menu-link.active .menu-title {
    color: var(--bs-primary) !important;
    font-weight: 600;
}
#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);
}

/* ---- 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; }

/* ---- Loader locale su pannelli/card/div ---- */
.sm-block-loader-overlay {
  position: absolute;
  inset: 0;
  z-index: 980;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.56);
}
.sm-block-loader-box {
  --sk-color: var(--brand-primary, #2563eb);
  --sk-size: 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  text-align: center;
  padding: .25rem;
  border-radius: 8px;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.sm-block-loader-text {
  font-size: .78rem;
  font-weight: 600;
  color: var(--brand-danger);
}
.sm-block-loader-overlay--modal {
  background: rgba(15, 23, 42, 0.20);
  backdrop-filter: blur(1px);
}
.sm-block-loader-overlay--premium {
  background: rgba(15, 23, 42, 0.10);
  backdrop-filter: blur(1.2px);
}
.sm-block-loader-overlay--premium .sm-block-loader-box {
  min-width: 160px;
  padding: .35rem .5rem .2rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.30);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}
.sm-block-loader-overlay--premium .sm-block-loader-box .sk-circle-fade,
.sm-block-loader-overlay--premium .sm-block-loader-box .sk-chase,
.sm-block-loader-overlay--premium .sm-block-loader-box .sk-flow,
.sm-block-loader-overlay--premium .sm-block-loader-box .sk-grid {
  filter: drop-shadow(0 0 3px rgba(37, 99, 235, 0.16));
}
.sm-block-loader-overlay--premium .sm-block-loader-text {
  color: var(--brand-danger);
  font-weight: 600;
  letter-spacing: .01em;
}
.sm-block-loader-overlay--app {
  background: linear-gradient(180deg, rgba(247, 249, 252, 0.82) 0%, rgba(247, 249, 252, 0.9) 100%);
  backdrop-filter: blur(1.5px);
}
.sm-block-loader-overlay--app .sm-block-loader-box {
  --sk-color: var(--brand-primary);
  --sk-size: 30px;
  min-width: 220px;
  padding: .85rem 1.1rem .75rem;
  border-radius: 12px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}
.sm-block-loader-overlay--app .sm-block-loader-box .sk-flow {
  padding: 8px;
}
.sm-block-loader-overlay--app .sm-block-loader-text {
  color: #334155;
  font-weight: 600;
}
.sm-block-loader-overlay--app .sm-block-loader-box .sk-flow-dot {
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.22);
}

/* Brand color overrides Bootstrap/Metronic sono ora gestiti da
   custom.themes.css (override --bs-primary cascading).
   Lasciato solo il tint specifico dello spinner loader. */
