.button-row {
  display: flex;
  justify-content: flex-start; /* posizionamento a sinistra */
  gap: 10px;
}

/* Base button styles */
.btn {
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  border: none;
  color: #fff;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Button sizes */
.btn-xs {
  min-width: 30px;
  height: 24px;
  font-size: 12px;
  padding: 0 10px;
  white-space: nowrap;
}

.btn-s {
  min-width: 50px;
  height: 30px;
  font-size: 14px;
  padding: 0 15px;
  white-space: nowrap;
}

.btn-m {
  min-width: 100px;
  height: 40px;
  font-size: 15px;
  padding: 0 20px;
}

.btn-l {
  min-width: 150px;
  height: 40px;
  font-size: 15px;
  padding: 0 20px;
}

/* Versione solo icona per bottoni extra small */
.btn-xs.icon-only {
  min-width: 24px;
  width: 24px;
  padding: 0;
}

.btn-xs.icon-only::before {
  margin-right: 0;
}

.btn:hover {
  color: #fff;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Button types */
.submit-btn {
  background: #cc0000;
}

.reset-btn {
  background: #999;
}

.primary-btn {
  background: #0d6efd;
}

.secondary-btn {
  background: #6c757d;
}

.success-btn {
  background: #198754;
}

.warning-btn {
  background: #ffc107;
}

.danger-btn {
  background: #dc3545;
}

.info-btn {
  background: #0dcaf0;
}

.search-btn {
  background: #17a2b8;
}

.download-btn {
  background: #394457;
  padding: 5px 7px !important;
}

.download-btn:before {
    top: -2px;
    position: relative;
}

.trash-btn {
  background: #dc3545;
  color: #fff;
}

/* Disabled state */
.btn:disabled,
.btn.disabled {
  opacity: 0.65;
  cursor: not-allowed;
  box-shadow: none;
}

/* Hover states */
.submit-btn:hover {
  background: #990000;
}

.reset-btn:hover {
  background: #777;
}

.primary-btn:hover {
  background: #0a58ca;
}

.secondary-btn:hover {
  background: #5c636a;
}

.success-btn:hover {
  background: #13653f;
}

.warning-btn:hover {
  background: #d39e00;
}

.danger-btn:hover {
  background: #a52834;
}

.info-btn:hover {
  background: #0b92b1;
}

.search-btn:hover {
  background: #117a8b;
}

.download-btn:hover {
  background: #1f2631;
}

.trash-btn:hover {
  background: #a52834;
  color: #fff;
}

/* Icons */
.submit-btn::before,
.reset-btn::before,
.primary-btn::before,
.secondary-btn::before,
.success-btn::before,
.warning-btn::before,
.danger-btn::before,
.info-btn::before,
.search-btn::before,
.assegna-btn::before,
.download-btn::before,
.trash-btn::before {
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
}

.btn:not(:empty)::before {
  margin-right: 8px;
}

.submit-btn::before {
  content: "\f1d8"; /* icona invio */
}

.reset-btn::before {
  content: "\f2f1"; /* icona reset */
}

.primary-btn::before {
  content: "\f055"; /* icona plus circle */
}

.secondary-btn::before {
  content: "\f0b0"; /* icona filtro */
}

.success-btn::before {
  content: "\f00c"; /* icona check */
}

.warning-btn::before {
  content: "\f12a"; /* icona exclamation */
}

.danger-btn::before {
  content: "\f057"; /* icona times circle */
}

.info-btn::before {
  content: "\f05a"; /* icona info */
}

.search-btn::before {
  content: "\f002"; /* icona lente di ingrandimento */
}

.download-btn::before {
  content: "\f019"; /* icona download */
}

.trash-btn::before {
  content: "\f1f8"; /* Icona cestino */
}

/*Cookie btn */
.cb-enable, .cb-enable:hover {
  background: #fff;
  padding: 7px 14px;
  color: #000;
  cursor: pointer;
}


/* Table buttons */
.table-head-btn {
  background: #6c7383;
  padding: 7px 14px;
  font-size: 12px;
  color: #fff;
  border-radius: 5px;
}

.table-head-btn:hover {
  color: #fff;
  background: #5a6374;
}

.table-action-btn {
  border: none;
  border-radius: 5px;
  padding: 8px;
  color: #fff;
  background: #6c7383;
}

.table-action-btn.search {
  background: #0d6efd;
}

.table-action-btn.clean {
  background: #dc3545;
}

/* Full width button */
.w-100 {
  width: 100% !important;
  min-width: 100% !important;
  display: block;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .button-row {
    flex-direction: column;
    gap: 8px;
  }
  
  .btn-xs,
  .btn-s,
  .btn-m {
    width: 100%;
    min-width: 100%;
  }

  #tab_allegati td.text-center .btn-xs + .btn-xs {
    /* Seleziona un bottone .btn-xs che segue immediatamente un altro .btn-xs
       all'interno della cella di azione della tabella allegati */
    margin-top: 8px; /* Aggiunge uno spazio a sinistra del secondo bottone (e successivi) */
  }
}

/* Link button styles */
.btn-link {
  background: transparent !important;
  color: #17a2b8 !important;
  text-transform: none !important;
  padding: 0 !important;
  min-width: auto !important;
  border-radius: 0 !important;
  text-decoration: underline;
  box-shadow: none !important;
}

.btn-link:hover {
  color: #138496 !important;
  text-decoration: none;
  background: transparent !important;
}

/* Search link button specific styles */
.btn-link.search-btn {
  color: #17a2b8;
}

.btn-link.search-btn:hover {
  color: #138496;
}

.btn-link.search-btn::before {
  content: "\f002"; /* icona lente di ingrandimento */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  margin-right: 5px;
  text-decoration: none;
}

/* Versione solo icona */
.btn-link.search-btn.icon-only::before {
  margin-right: 0;
  text-decoration: none;
}

/* ticket */
.assegna-btn{
  background: green;
  color: #fff;
}

.assegna-btn:hover{
  background: #015a01;
  color: #fff;
}

.assegna-btn::before {
  content: "\f46c"; /* icona persona */
}

/* Effetto ingrandimento per icone action-ico */
.action-ico {
  transition: transform 0.2s ease-in-out;
}

a:hover .action-ico,
button:hover .action-ico {
  transform: scale(1.2);
}

/* Versione più pronunciata per i bottoni */
.btn:hover .action-ico {
  transform: scale(1.3);
}


.btn.no-default-icon::before {
  content: none !important; /* Rimuove l'icona predefinita */
  margin-right: 0 !important; /* Rimuove il margine aggiunto per l'icona predefinita */
}

/* Assicura che l'icona interna (<i>) abbia il margine corretto se c'è testo */
.btn.no-default-icon i + span, /* Se usi span per il testo */
.btn.no-default-icon i /* Se non usi span e il testo segue direttamente */
{
   margin-left: 8px; /* Ripristina il margine che ::before avrebbe aggiunto */
}
/* Se l'icona è l'unico contenuto, non aggiungere margine */
.btn.no-default-icon i:only-child {
  margin-left: 0;
}
