/* =========================================================
   ASI THEME
   Palette ricavata dal logo ASI
   ========================================================= */

:root {
  --asi-blue: #32378D;
  --asi-blue-dark: #283583;
  --asi-gray: #4A4A49;
  --asi-light-gray: #F3F5F6;
  --asi-white: #FFFFFF;

  /* Bootstrap 5 - primary color override */
  --bs-primary: #32378D;
  --bs-primary-rgb: 50, 55, 141;
  --bs-link-color: #32378D;
  --bs-link-hover-color: #283583;
}

/* =========================================================
   GLOBAL / BOOTSTRAP OVERRIDES
   ========================================================= */

body {
  background-color: var(--asi-light-gray);
  color: var(--asi-gray);
}

a {
  color: var(--asi-blue);
}

a:hover,
a:focus {
  color: var(--asi-blue-dark);
}

.btn-primary {
  background-color: var(--asi-blue);
  border-color: var(--asi-blue);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active,
.show > .btn-primary.dropdown-toggle {
  background-color: var(--asi-blue-dark);
  border-color: var(--asi-blue-dark);
}

.btn-outline-primary {
  color: var(--asi-blue);
  border-color: var(--asi-blue);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active,
.btn-outline-primary.active {
  color: var(--asi-white);
  background-color: var(--asi-blue);
  border-color: var(--asi-blue);
}

.bg-primary {
  background-color: var(--asi-blue) !important;
}

.text-primary {
  color: var(--asi-blue) !important;
}

.border-primary {
  border-color: var(--asi-blue) !important;
}

.badge-primary {
  background-color: var(--asi-blue);
  color: var(--asi-white);
}

.nav-pills .nav-link.active,
.nav-pills .show > .nav-link,
.dropdown-item.active,
.dropdown-item:active {
  background-color: var(--asi-blue);
  color: var(--asi-white);
}

.page-link {
  color: var(--asi-blue);
}

.page-link:hover,
.page-link:focus {
  color: var(--asi-blue-dark);
}

.page-item.active .page-link {
  background-color: var(--asi-blue);
  border-color: var(--asi-blue);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--asi-blue);
  box-shadow: 0 0 0 0.2rem rgba(50, 55, 141, 0.18);
}

/* =========================
   TABULATOR STYLE - ASI
   ========================= */

.tabulator {
  border: 1px solid rgba(74, 74, 73, 0.20);
  border-radius: 0.5rem;
  background-color: var(--asi-white);
  font-size: 0.95rem;
  overflow: hidden;
  box-shadow: 0 0 1px rgba(0,0,0,.125), 0 1px 3px rgba(0,0,0,.08);
}

/* Header generale */
.tabulator .tabulator-header {
  background-color: var(--asi-light-gray);
  border-bottom: 1px solid rgba(74, 74, 73, 0.20);
  color: var(--asi-gray);
  font-weight: 600;
}

/* Colonne header */
.tabulator .tabulator-header .tabulator-col {
  background-color: var(--asi-light-gray);
  border-right: 1px solid rgba(74, 74, 73, 0.14);
  padding-top: 8px;
  padding-bottom: 8px;
}

/* Titolo colonna */
.tabulator .tabulator-header .tabulator-col .tabulator-col-content {
  padding: 10px 12px;
}

/* Input e select header filter */
.tabulator .tabulator-header input,
.tabulator .tabulator-header select,
.tabulator .tabulator-header textarea {
  width: 100%;
  min-height: 34px;
  border: 1px solid rgba(74, 74, 73, 0.28);
  border-radius: 0.375rem;
  background-color: var(--asi-white);
  color: var(--asi-gray);
  font-size: 0.875rem;
  padding: 0.375rem 0.75rem;
  outline: none;
  box-shadow: none;
}

.tabulator .tabulator-header input:focus,
.tabulator .tabulator-header select:focus,
.tabulator .tabulator-header textarea:focus {
  border-color: var(--asi-blue);
  box-shadow: 0 0 0 0.15rem rgba(50, 55, 141, 0.18);
}

/* Corpo tabella */
.tabulator .tabulator-tableholder {
  background-color: var(--asi-white);
}

.tabulator .tabulator-row {
  background-color: var(--asi-white);
  border-bottom: 1px solid rgba(74, 74, 73, 0.10);
  min-height: 44px;
}

.tabulator .tabulator-row:nth-child(even) {
  background-color: rgba(243, 245, 246, 0.65);
}

.tabulator .tabulator-row:hover {
  background-color: rgba(50, 55, 141, 0.07) !important;
}

.tabulator .tabulator-row.tabulator-selected {
  background-color: rgba(50, 55, 141, 0.15) !important;
}

/* Celle */
.tabulator .tabulator-cell {
  border-right: 1px solid rgba(74, 74, 73, 0.10);
  padding: 10px 12px;
  vertical-align: middle;
}

/* Riga attiva/modificata */
.tabulator .tabulator-row.tabulator-row-even.tabulator-selectable:hover,
.tabulator .tabulator-row.tabulator-selectable:hover {
  cursor: pointer;
}

/* Footer */
.tabulator .tabulator-footer {
  background-color: var(--asi-light-gray);
  border-top: 1px solid rgba(74, 74, 73, 0.20);
  padding: 8px 10px;
}

/* Paginazione */
.tabulator .tabulator-footer .tabulator-paginator {
  font-size: 0.875rem;
}

.tabulator .tabulator-footer .tabulator-page {
  border: 1px solid rgba(74, 74, 73, 0.28);
  background: var(--asi-white);
  color: var(--asi-blue);
  border-radius: 0.375rem;
  margin: 0 2px;
  padding: 4px 10px;
}

.tabulator .tabulator-footer .tabulator-page:hover {
  background-color: rgba(50, 55, 141, 0.08);
  border-color: var(--asi-blue);
}

.tabulator .tabulator-footer .tabulator-page.active {
  background-color: var(--asi-blue);
  border-color: var(--asi-blue);
  color: var(--asi-white);
}

/* Placeholder tabella vuota */
.tabulator .tabulator-tableholder .tabulator-placeholder span {
  color: var(--asi-gray);
  font-size: 0.95rem;
}

/* Sort arrow */
.tabulator .tabulator-col .tabulator-arrow {
  border-top-color: var(--asi-gray);
}

/* Responsive collapse */
.tabulator .tabulator-responsive-collapse {
  border-top: 1px dashed rgba(74, 74, 73, 0.22);
  padding: 10px 12px;
  background-color: var(--asi-light-gray);
}

/* Editing cell */
.tabulator .tabulator-cell.tabulator-editing {
  border: 1px solid var(--asi-blue) !important;
  border-radius: 0.375rem;
  background-color: var(--asi-white);
  box-shadow: inset 0 0 0 1px rgba(50, 55, 141, 0.12);
}

/* Editor input dentro cella */
.tabulator .tabulator-cell input,
.tabulator .tabulator-cell select,
.tabulator .tabulator-cell textarea {
  border: 1px solid rgba(74, 74, 73, 0.28);
  border-radius: 0.375rem;
  padding: 0.35rem 0.65rem;
  font-size: 0.875rem;
  background-color: var(--asi-white);
  color: var(--asi-gray);
}

/* Scrollbar più pulita */
.tabulator .tabulator-tableholder::-webkit-scrollbar {
  height: 10px;
  width: 10px;
}

.tabulator .tabulator-tableholder::-webkit-scrollbar-thumb {
  background: rgba(74, 74, 73, 0.35);
  border-radius: 999px;
}

.tabulator .tabulator-tableholder::-webkit-scrollbar-thumb:hover {
  background: var(--asi-blue);
}

.tabulator .tabulator-tableholder::-webkit-scrollbar-track {
  background: var(--asi-light-gray);
}

/* =========================
   GLOBAL LOADING OVERLAY
   ========================= */

#globalLoading {
    position: fixed;
    inset: 0;
    background: rgba(243, 245, 246, 0.82);
    z-index: 20000;

    display: none;
    align-items: center;
    justify-content: center;
}

#globalLoading.show {
    display: flex;
}

.loading-box {
    background: var(--asi-white);
    padding: 12px 30px 25px;
    border-radius: 14px;
    border: 1px solid rgba(50, 55, 141, 0.12);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
    text-align: center;
}

.loading-box .spinner-border {
    width: 3rem;
    height: 3rem;
    color: var(--asi-blue);
}

.loading-text {
    margin-top: 15px;
    font-weight: 600;
    color: var(--asi-blue);
}

/* =========================================================
   GUIDA
   ========================================================= */

.guide-step-number {
    width: 58px;
    height: 58px;

    min-width: 58px;

    border-radius: 50%;

    background-color: var(--asi-blue);
    color: var(--asi-white);

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 1.5rem;
    font-weight: 700;

    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}

.guide-step-number:hover {
    background-color: var(--asi-blue-dark);
}

.guide-arrow {
    font-size: 2rem;
    color: var(--asi-blue);
    margin-top: -10px;
    margin-bottom: 15px;
}

@media (max-width: 576px) {

    .guide-step-number {
        width: 45px;
        height: 45px;

        min-width: 45px;

        font-size: 1.2rem;
    }

}

.site-logo {
    width: 330px;
    height: 300px;
}

/* =========================================================
   ASSISTENZA WHATSAPP
   ========================================================= */

.whatsapp-support-btn {
    background-color: #25D366;
    border-color: #25D366;
    color: #FFFFFF;
    font-weight: 600;
}

.whatsapp-support-btn:hover,
.whatsapp-support-btn:focus {
    background-color: #1ebe5d;
    border-color: #1ebe5d;
    color: #FFFFFF;
}