/* === Layout generale === */
body {
  margin: 0;
  font-family: "Inter", sans-serif;
  background: #f5f6fa;
  color: #333;
}

.wrapper {
  display: flex;
  min-height: 100vh;
}

/* === Sidebar === */
.sidebar {
  width: 240px;
  background-color: #0A2D51;
  color: #ddd;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
}

.sidebar-logo {
  text-align: center;
  padding: 15px;
  border-bottom: 1px solid #333;
}

.sidebar-logo img {
  max-width: 150px;
  filter: brightness(0.9);
}

.sidebar-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.sidebar-menu li {
  margin: 0;
}

.sidebar-menu a {
  display: block;
  padding: 12px 20px;
  color: #ccc;
  text-decoration: none;
  transition: 0.2s;
}



.sidebar-menu a:hover,
.sidebar-menu a.active {
  background: #08243f;
  color: #fff;
}

/* === Contenuto principale === */
.main {
  margin-left: 240px;
  padding: 20px;
  flex: 1;
}

/* === Tabelle e modali === */
.table td[contenteditable="true"] {
  background: #fff7e6;
}

.modal-header {
  background-color: #1c1c1e;
  color: #fff;
}

.pagination {
  justify-content: center;
}

.pagination .page-link {
  background-color: #1c1c1e;
  border-color: #1c1c1e;
  color: #fff;
}

.pagination .page-link:hover {
  background-color: #08243f;
  color: #fff;
}

.pagination .active .page-link {
  background-color: #0A2D51;
  border-color: #0A2D51;
  color: #fff;
}

/* === Bottoni === */
.btn-primary {
  background-color: #0A2D51;
  border: none;
}
.btn-primary:hover {
  background-color: #08243f;
}

.btn-dark {
  background-color: #0A2D51;
  border: none;
}
.btn-primary:hover {
  background-color: #08243f;
}

/* === Select2 personalizzato === */
.select2-container--bootstrap-5 .select2-selection {
  background-color: #fff !important;
  border: 1px solid #dee2e6 !important;
  color: #fff !important;
  border-radius: 6px;
  min-height: 35px;
}
.select2-container--bootstrap-5 .select2-selection__rendered {
  color: #222 !important;
  line-height: 36px;
}

.select2-container .select2-selection--single .select2-selection__rendered {
  display: contents !important;
}
.select2-dropdown {
  background-color: #fff;
  color: #222;
}

/* Hover sulla voce nel dropdown */
.select2-container--bootstrap-5 .select2-results__option:hover {
  background-color: #222 !important;
  color: white !important;
}

/* Mostra la freccetta come nei select Bootstrap */
.select2-container--bootstrap-5 .select2-selection--single::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 10px;
  width: 0;
  height: 0;
  pointer-events: none;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #495057;
  transform: translateY(-50%);
}

/* Evita che il testo si sovrapponga alla freccia */
.select2-container--bootstrap-5 .select2-selection--single {
  padding-right: 25px !important;
  position: relative;
   padding-left: 0.75rem;
}


 .main h3 {
    color:#0A2D51;
  }

/* ===================================================================== */
/* === RESPONSIVE MOBILE + TABLET (FINO A 992px) ======================= */
/* ===================================================================== */

@media (max-width: 992px) {

  /* === Sidebar disattivata === */
  .sidebar {
    display: none !important;
  }

  .main {
    margin-left: 0 !important;
    width: 100% !important;
    padding: 1rem !important;
  }

  /* === Modali full-screen === */
  .modal-dialog,
  .modal-dialog.modal-lg {
    width: 90% !important;
    max-width: 90% !important;
    height: auto !important;
    margin: 0 auto !important;
  }

  .modal-content {
    height: auto !important;
    border-radius: 0.75rem !important;
  }

  /* === Filtri verticali === */
  #filtroForm .d-flex,
  #filtroForm .d-flex.flex-wrap {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  #filtroForm .flex-grow-1,
  #filtroForm > div {
    width: 100% !important;
  }

  /* === Tabelle verticali (stile card) === */
  table.table {
    border: 0 !important;
  }

  table.table thead {
    display: none !important;
  }

  table.table tbody tr {
    display: block !important;
    margin-bottom: 1rem !important;
    border: 1px solid #ccc !important;
    border-radius: 8px !important;
    padding: 0.75rem !important;
    background: #fff !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1) !important;
  }

  table.table tbody td {
    display: flex !important;
    justify-content: space-between !important;
    border: none !important;
    padding: 0.4rem 0 !important;
  }

  table.table tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #444;
  }

  table.table tbody td:last-child {
    justify-content: flex-start !important;
    gap: 0.4rem !important;
  }

  /* === Titolo pagina centrato === */
  .main h3 {
    text-align: center;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color:#0A2D51;
  }

 
  .main .d-flex.justify-content-between.align-items-center.mb-3 {
    flex-direction: column !important;
    align-items: center !important;
    gap: 10px;
  }

  .main .d-flex.justify-content-between.align-items-center.mb-3 > div {
    display: flex;
    width: 100%;
    justify-content: space-between;
  }

  /* === Padding per bottom bar === */
  body {
    padding-bottom: 75px;
  }
}
/* === Bottom Bar Mobile (refined spacing) === */

  .bottom-bar {
    position: fixed!important;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: #0A2D51;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1050;
    border-top: 1px solid #333;
    padding: 8px 8px 0; /* 🟢 aggiunto spazio sopra, leggero padding laterale */
  }

  .bottom-link {
    flex: 1;
    color: #aaa;
    text-align: center;
    font-size: 12px;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px; /* 🔻 meno spazio tra icona e testo */
  }

  .bottom-link i {
    font-size: 20px;
    line-height: 1;
  }

  .bottom-link span {
    font-size: 11px;
    margin-top: 1px;
  }

  .bottom-link.active,
  .bottom-link:hover {
    color: #fff;
  }




/* Desktop: affiancati, dimensione naturale */
@media (min-width: 768px){
  .td-actions{
    display: flex;
    align-items: center;
    gap: .4rem;
    justify-content: flex-start; /* o flex-end se li vuoi a destra */
  }
  .td-actions .w-50{
    flex: 0 0 auto !important;
    width: 45% !important;
  }
}


