/**
 * style.css - Stili ottimizzati per il gestionale siti web
 */

/* Importazione del font Poppins */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* Variabili CSS */
:root {
  --primary-color: #ff7518;          /* Arancione primario (brand) */
  --primary-hover: #f54703;          /* Arancione hover (brand) */
  --secondary-color: #464545;        /* Grigio secondario (brand) */
  --secondary-light: #686868;        /* Grigio secondario più chiaro */
  --success-color: #28a745;          /* Verde successo */
  --warning-color: #ffc107;          /* Giallo avviso */
  --danger-color: #dc3545;           /* Rosso pericolo */
  --info-color: #2f2f2f;             /* Grigio scuro info (brand) */
  --dark-color: #1b1b1b;             /* Quasi nero (brand) */
  --bg-color: #f0f0f1;               /* Sfondo chiaro (brand) */
  --bg-alt-color: #f8f8f9;           /* Sfondo alternativo per righe tabella */
  --card-color: #ffffff;             /* Bianco per card */
  --text-color: #1b1b1b;             /* Testo scuro (brand) */
  --text-muted: #6c757d;             /* Testo secondario */
  --link-color: var(--primary-color); /* Colore link */
  --border-color: rgba(0,0,0,0.1);   /* Bordi sottili */
  --border-radius: 0.5rem;           /* Angoli arrotondati */
  --shadow-sm: 0 2px 4px rgba(0,0,0,.025);
  --shadow: 0 4px 6px rgba(0,0,0,.035);
  --shadow-lg: 0 8px 16px rgba(0,0,0,.05);
  --transition: all 0.2s ease-in-out;
}

/* ===== STILI GENERALI ===== */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: 'Poppins', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
}

main {
  flex: 1;
  padding: 1.5rem 0;
}

a {
  color: var(--link-color);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-hover);
}

/* ===== NAVBAR ===== */
.navbar-dark.bg-primary {
  background-color: var(--dark-color) !important;
  box-shadow: var(--shadow);
}

.navbar .nav-link {
  color: rgba(255, 255, 255, 0.85) !important;
  font-weight: 500;
  padding: 0.75rem 1rem;
  transition: var(--transition);
}

.navbar .nav-link.active {
  color: var(--primary-color) !important;
  position: relative;
}

.navbar .nav-link:hover {
  color: var(--primary-color) !important;
}

.navbar-brand {
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* ===== FOOTER ===== */
.footer {
  background-color: var(--dark-color) !important;
  color: rgba(255, 255, 255, 0.75);
  padding: 1.5rem 0;
  width: 100%;
  margin-top: 2rem;
}

.footer a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

.footer a:hover {
  color: var(--primary-hover);
  text-decoration: none;
}

/* ===== CARDS ===== */
.card {
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
  border: none;
  border-radius: var(--border-radius);
  overflow: hidden;
  transition: var(--transition);
  animation: fadeIn 0.5s ease-out forwards;
}

.card:hover {
  box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.card-header {
  background-color: var(--card-color);
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
  padding: 1rem 1.25rem;
}

.card-body {
  padding: 1.25rem;
}

.card .table {
  margin-bottom: 0;
}

.card-header h5 {
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 0;
}

/* Website Header */
.website-header {
  padding: 1.5rem 0;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

/* ===== BOTTONI E AZIONI ===== */
.btn {
  font-weight: 500;
  padding: 0.5rem 1.25rem;
  border-radius: var(--border-radius);
  transition: var(--transition);
}

.btn-sm {
  padding: 0.25rem 0.75rem;
  font-size: 0.85rem;
}

/* Regola dimensione icone nei pulsanti */
.btn i {
  font-size: 0.9em;
}

/* Rimuove il margin-right per i pulsanti con solo icona */
.btn i:only-child {
  margin-right: 0 !important;
}

/* Aggiunge margin-right solo quando c'è testo dopo l'icona */
.btn i:not(:only-child) {
  margin-right: 0.25rem;
}

/* Stile pulsanti con solo icona */
.btn-icon {
  min-width: 45px;
  height: 45px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius);
}

.btn-icon i {
  font-size: 1rem;
  margin: 0;
}

.btn-icon:hover {
  transform: none; /* Rimuove lo spostamento verticale */
  box-shadow: 0 0 0 0.2rem rgba(255, 117, 24, 0.15);
}

/* Colori dei bottoni */
.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-primary:hover, .btn-primary:focus {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
  box-shadow: 0 0 0 0.2rem rgba(255, 117, 24, 0.15);
}

.btn-secondary {
  background-color: var(--secondary-color);
  border-color: var(--secondary-color);
}

.btn-secondary:hover {
  background-color: var(--secondary-light);
  border-color: var(--secondary-light);
}

.btn-warning {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

.btn-warning:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
  color: white;
}

.btn-danger {
  background-color: var(--danger-color);
  border-color: var(--danger-color);
}

.btn-info {
  background-color: var(--secondary-color);
  border-color: var(--secondary-color);
  color: white;
}

.btn-info:hover {
  background-color: var(--secondary-light);
  border-color: var(--secondary-light);
  color: white;
}

/* Icone per pulsanti azione con migliore contrasto */
.btn-info i, .btn-warning i, .btn-danger i, .btn-secondary i, .btn-primary i {
  color: #ffffff;
}

/* Effetto hover migliorato per pulsanti azione */
.btn-group-sm .btn {
  border-radius: 0.375rem;
  margin: 0 1px;
  padding: 0.375rem 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-group-sm .btn i {
  font-size: 0.85rem;
}

.btn-group-sm .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

/* Pulsanti outline */
.btn-outline-primary {
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
}

.btn-outline-primary:hover {
  background-color: var(--primary-color);
  color: white;
}

.btn-outline-secondary {
  color: var(--secondary-color);
  border: 1px solid var(--secondary-color);
}

.btn-outline-secondary:hover {
  background-color: var(--secondary-color);
  color: white;
}

/* ===== BADGE E STATI ===== */
.badge {
  padding: 0.5em 0.75em;
  font-weight: 500;
  font-size: 0.75rem;
  border-radius: 30px;
  letter-spacing: 0.5px;
}

.bg-primary {
  background-color: var(--primary-color) !important;
}

.bg-secondary {
  background-color: var(--secondary-color) !important;
}

.bg-success {
  background-color: var(--success-color) !important;
}

.bg-warning {
  background-color: var(--warning-color) !important;
}

.bg-danger {
  background-color: var(--danger-color) !important;
}

.bg-info {
  background-color: var(--info-color) !important;
}

/* ===== FORMS E INPUTS ===== */
.form-control, .form-select {
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  padding: 0.65rem 1rem;
  min-height: 45px;
  font-size: 0.95rem;
  transition: var(--transition);
  background-color: #f8f9fa;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(255, 117, 24, 0.08);
  background-color: #ffffff;
}

.form-control-color {
  width: 60px!important;
}

.form-label {
  color: var(--text-color);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.form-text {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

/* Migliora l'aspetto del toggle password */
.input-group .toggle-password {
  border-left: none;
  background-color: #fff;
  border-color: #ced4da;
}

.input-group .toggle-password:hover, 
.input-group .toggle-password:focus {
  background-color: #f8f9fa;
  box-shadow: none;
  border-color: #ced4da;
}

.input-group .toggle-password i {
  color: #6c757d;
}

.input-group .form-control:focus + .toggle-password {
  border-color: #86b7fe;
}

.form-check-input:checked {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

/* ===== TABELLE ===== */
.table-responsive {
  border-radius: var(--border-radius);
  overflow-x: auto;
  width: 100%;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1rem;
}

.table {
  font-size: 0.95rem;
  margin-bottom: 0;
  width: 100%;
}

.table thead th {
  border-top: none;
  background-color: rgba(0,0,0,0.03);
  color: var(--text-color);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  padding: 0.85rem 1rem;
  cursor: pointer;
  transition: background-color 0.2s;
  white-space: nowrap;
}

.table thead th:hover {
  background-color: rgba(0,0,0,0.05);
}

.table tbody td {
  padding: 0.85rem 1rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--border-color);
}

.table-striped tbody tr:nth-of-type(odd) {
  background-color: var(--bg-alt-color);
}

.table-hover tbody tr:hover {
  background-color: rgba(0,0,0,0.02);
}

/* Link nelle tabelle (non blu) */
.table a {
  color: var(--text-color);
  font-weight: 500;
}

.table a:hover {
  color: var(--primary-color);
}

/* Stile per le intestazioni ordinabili */
.sort-link {
  color: var(--text-color);
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sort-link:hover {
  color: var(--primary-color);
}

.sort-link i {
  margin-left: 5px;
  opacity: 0.5;
}

.sort-link:hover i {
  opacity: 1;
}

/* Uniforma l'allineamento delle celle nelle tabelle */
.table td, 
.table th {
  vertical-align: middle !important;
}

/* Soluzione per l'allineamento uniforme dei pulsanti azioni nelle tabelle */
.table td:last-child,
.table th:last-child {
  text-align: center !important;
  width: 100px; /* Larghezza fissa per la colonna azioni */
}

/* Allineamento uniforme dei pulsanti azione */
.table td:last-child .btn,
.table td:last-child .btn-group {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
}

/* Tabelle nella dashboard */
.table-dashboard td, 
.table-dashboard th {
  vertical-align: middle !important;
}

.table-dashboard td:last-child,
.table-dashboard th:last-child {
  text-align: center !important;
  width: 100px; /* Larghezza fissa per la colonna azioni */
}

.table-dashboard td .btn,
.table-dashboard td .btn-group {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

/* ===== FILTRI ===== */
.filters-container {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 15px;
  width: 100%;
}

.filter-item {
  flex: 1;
  min-width: 200px;
  max-width: 100%;
}

.filter-buttons {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  margin-left: auto;
  padding-bottom: 5px; /* Per allineare con gli input */
}

/* Stile per il contenitore dei filtri */
.row.g-3.align-items-end {
  margin-bottom: 0;
}

.col-auto.ms-auto {
  display: flex;
  gap: 8px;
}

/* ===== TABS ===== */
.custom-tabs .nav-link {
  border: none;
  color: var(--text-muted);
  padding: 0.85rem;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
  font-weight: 500;
  border-radius: 0;
}

.custom-tabs .nav-link:hover {
  color: var(--primary-color);
}

.custom-tabs .nav-link.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
  background-color: transparent;
  font-weight: 600;
}

/* ===== DASHBOARD ===== */
.dashboard-stat-card {
  transition: var(--transition);
  border-radius: var(--border-radius);
  overflow: hidden;
  height: 100%;
  animation: fadeIn 0.5s ease-out forwards;
}

.dashboard-stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.dashboard-stat-icon {
  font-size: 2.5rem;
  opacity: 0.15;
  position: absolute;
  right: 20px;
  top: 20px;
  color: var(--primary-color);
}

.dashboard-stat-card .card-body {
  position: relative;
  z-index: 1;
  padding: 1.5rem;
}

.dashboard-stat-card .card-title {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 1rem;
  color: var(--text-muted);
}

.dashboard-stat-card .display-4 {
  font-weight: 600;
  margin-bottom: 0;
  color: var(--text-color);
}

/* ===== NOTE ===== */
.note-card {
  border-left: 3px solid var(--primary-color);
  background-color: var(--card-color);
  transition: var(--transition);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  animation: fadeIn 0.5s ease-out forwards;
}

.note-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.note-card.important {
  border-left-color: var(--danger-color);
}

.note-content {
  color: var(--text-color);
  line-height: 1.6;
}

/* ===== ALERT ===== */
.alert {
  border-radius: var(--border-radius);
  border: none;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.alert-success {
  background-color: rgba(40, 167, 69, 0.1);
  color: var(--success-color);
}

.alert-danger {
  background-color: rgba(220, 53, 69, 0.1);
  color: var(--danger-color);
}

.alert-warning {
  background-color: rgba(255, 117, 24, 0.1);
  color: var(--primary-color);
}

.alert-info {
  background-color: rgba(47, 47, 47, 0.1);
  color: var(--info-color);
}

/* ===== DROPDOWN MENU ===== */
.dropdown-menu {
  border-radius: var(--border-radius);
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  padding: 0.5rem;
  border: none;
}

.dropdown-item {
  padding: 0.5rem 1rem;
  border-radius: calc(var(--border-radius) - 0.25rem);
  transition: var(--transition);
  margin-bottom: 2px;
}

.dropdown-item:hover, .dropdown-item:focus {
  background-color: rgba(255, 117, 24, 0.08);
  color: var(--primary-color);
}

.dropdown-item i {
  width: 1.25rem;
  text-align: center;
  margin-right: 0.5rem;
  opacity: 0.8;
}

/* ===== MODALI ===== */
.modal-content {
  border-radius: var(--border-radius);
  border: none;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  border-bottom-color: var(--border-color);
  padding: 1.25rem 1.5rem;
}

.modal-footer {
  border-top-color: var(--border-color);
  padding: 1.25rem 1.5rem;
}

.modal-body {
  padding: 1.5rem;
}

/* ===== ACCORDION ===== */
.accordion-item {
  box-shadow: 0 2px 4px rgba(0,0,0,.03);
  border-radius: 0.5rem;
  overflow: hidden;
  margin-bottom: 1rem;
}

.accordion-button {
  padding: 1rem 1.25rem;
  background-color: white;
}

.accordion-button:not(.collapsed) {
  color: var(--primary-color);
  background-color: rgba(255, 117, 24, 0.05);
}

.accordion-button:focus {
  box-shadow: 0 0 0 0.25rem rgba(255, 117, 24, 0.15);
  border-color: rgba(255, 117, 24, 0.5);
}

.accordion-button::after {
  background-size: 1.2rem;
  transition: all 0.2s ease;
}

.selected-count {
  font-size: 0.75rem;
  background-color: var(--primary-color);
}

/* ===== ANIMAZIONI ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.animated-fade-in {
  animation: fadeIn 0.2s ease-out forwards;
}

/* ===== TOGGLE PASSWORD ===== */
.password-mask {
  user-select: none;
}

.toggle-password {
  cursor: pointer;
}

/* Icona circolare per le azioni rapide */
.icon-circle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Stile hover per i tag */
.btn-sm[style*="background-color"] {
  transition: all 0.2s ease;
}

.btn-sm[style*="background-color"]:hover {
  filter: brightness(85%);
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Responsività per il pulsante "Vedi tutti" */
.card-header .btn-outline-primary {
  padding: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Uniformare le intestazioni delle tabelle */
.dashboard-table-header {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  color: var(--text-color);
}

/* ===== RESPONSIVE ===== */
/* Stili per schermi molto grandi */
@media (min-width: 1920px) {
  .container-fluid {
    max-width: 1800px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

@media (min-width: 2560px) {
  .container-fluid {
    max-width: 2200px;
  }
}

/* Responsività per il pulsante "Vedi tutti" */
@media (max-width: 768px) {
  .card-header .btn-outline-primary span {
    display: none;
  }
  
  .card-header .btn-outline-primary {
    width: 38px;
    height: 38px;
    padding: 0.375rem;
  }
}

/* Dashboard responsive */
@media (max-width: 768px) {
  .dashboard-stat-card {
    margin-bottom: 15px !important;
  }
  
  .dashboard-stat-icon {
    font-size: 2rem;
    right: 15px;
    top: 15px;
  }
  
  .row > [class*="col-"] {
    margin-bottom: 15px;
  }
  
  .row > [class*="col-"]:last-child {
    margin-bottom: 0;
  }
  
  .navbar-brand {
    font-size: 1.1rem;
  }
  
  .card-title {
    font-size: 1.1rem;
  }
  
  .h3, h3 {
    font-size: 1.4rem;
  }
  
  .card-header {
    padding: 1rem;
  }
  
  .card-body {
    padding: 1.25rem;
  }
}

/* Tabelle responsive - mantenere lo scrolling orizzontale */
@media (max-width: 992px) {
  .table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    -ms-overflow-style: -ms-autohiding-scrollbar;
  }
  
  .table-responsive > .table {
    margin-bottom: 0;
  }
  
  .btn-group-sm .btn {
    padding: 0.375rem 0.5rem;
  }
}

/* Per i tablet e smartphone, aggiusta il layout dei filtri */
@media (max-width: 992px) {
  .filters-container {
    flex-direction: column;
  }
  
  .filter-item {
    width: 100%;
    max-width: 100%;
    min-width: 100%;
  }
  
  .filter-buttons {
    margin-left: 0;
    width: 100%;
    justify-content: flex-end;
    padding-bottom: 0;
    margin-top: 10px;
  }
  
  /* Rende i tabs responsive */
  .custom-tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -1rem;
    padding: 0 1rem;
  }
  
  .custom-tabs .nav-item {
    white-space: nowrap;
  }
  
  .custom-tabs .nav-link {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }
  
  /* Fix per il menu utente su mobile */
  .navbar .dropdown-toggle[aria-expanded="true"] + .dropdown-menu {
    display: block;
  }
  
  /* Stili per la navigazione mobile */
  .navbar-nav {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }
  
  .navbar-collapse {
    max-height: calc(100vh - 56px);
    overflow-y: auto;
  }
  
  .navbar .nav-link {
    padding: 0.5rem 0;
  }
  
  .navbar-dark .navbar-toggler {
    border: none;
    padding: 0.5rem;
  }

  /* Rimuove completamente l'outline del focus dall'hamburger menu */
  .navbar-toggler:focus {
    box-shadow: none;
    outline: none;
  }

/* Opzionale: stile personalizzato per l'hamburger menu */
  .navbar-toggler {
    border: none;
    padding: 0.5rem;
  }

/* Per mantenere accessibilità tramite tastiera ma con stile visivo meno invasivo */
  .navbar-toggler:focus-visible {
    outline: 1px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
  }
}

/* Stili per schermi piccoli */
@media (max-width: 576px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  .table-responsive {
    margin-bottom: 0.75rem;
  }
  
  .custom-tabs .nav-link {
    padding: 0.65rem 0.85rem;
    font-size: 0.9rem;
  }
  
  .footer {
    text-align: center;
  }
  
  .footer .d-flex {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }
  
  /* Aggiustamenti per i pulsanti */
  .btn-icon {
    min-width: 40px;
    height: 40px;
  }
  
  /* Miglioramento dello spacing nella dashboard */
  .row.mb-4 {
    margin-bottom: 0.5rem !important;
  }
  
  .row.mb-4 [class*="col-"] {
    margin-bottom: 15px;
  }
}

/* Miglioramento per filtri manutenzioni */
@media (min-width: 992px) {
  .maintenance-filters {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-end;
    gap: 10px;
  }
  
  .filter-buttons {
    margin-left: 0;
    padding-bottom: 0;
  }

  .maintenance-filters > div {
    flex: 1;
    min-width: 0;
  }
}

/* ===== OTTIMIZZAZIONI PER MOBILE ===== */

/* Troncare il testo nelle celle delle tabelle su mobile */
@media (max-width: 768px) {
  /* Testo troncato nelle tabelle su mobile */
  .table td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px; /* Puoi regolare questo valore in base alle tue esigenze */
  }
  
  /* Per le celle con testi critici (come titoli) limita la lunghezza */
  .table td.maintenance-type, 
  .table td.website-name,
  .table td.website-url,
  .table td.username,
  .table td.email {
    max-width: 130px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  /* Il testo dev'essere troncato anche quando ci sono elementi all'interno */
  .table td > a {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
  }
  
  /* Celle con tag possono andare a capo */
  .table td.tags-cell {
    white-space: normal;
    max-width: none;
  }
  
  /* Riduce la dimensione dei badge/tag su mobile */
  .table .badge {
    font-size: 0.65rem;
    padding: 0.35em 0.5em;
  }
  
  /* Adatta i bottoni nelle intestazioni su mobile */
  .d-flex.justify-content-between h1 + .btn,
  .d-flex.justify-content-between h5 + .btn,
  .card-header .btn {
    padding: 0.375rem;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  
  /* Nascondi il testo nei pulsanti su mobile, mostra solo l'icona */
  .d-flex.justify-content-between h1 + .btn span,
  .d-flex.justify-content-between h5 + .btn span,
  .card-header .btn span {
    display: none;
  }
  
  /* Assicurati che l'icona sia visibile e ben centrata */
  .d-flex.justify-content-between .btn i,
  .card-header .btn i {
    margin: 0;
    font-size: 1rem;
  }
  
  /* Migliora la spaziatura nella barra di navigazione su mobile */
  .navbar .form-control {
    margin-right: 8px;
  }
  
  /* Spaziatura tra la barra di ricerca e il dropdown utente */
  .navbar form.d-flex {
    margin-right: 10px;
  }
  
  /* Migliora la visualizzazione dello spazio dei filtri su mobile */
  .filters-container {
    gap: 10px;
  }
  
  /* Migliora il layout della tabella su mobile */
  .table-responsive {
    padding-bottom: 5px;
  }
  
  /* Adatta le dimensioni delle celle della tabella su mobile */
  .table td, .table th {
    padding: 0.7rem 0.75rem;
  }
  
  /* Ottimizza i pulsanti di azione su mobile */
  .btn-group-sm .btn {
    padding: 0.25rem 0.4rem;
  }
  
  /* Adatta la spaziatura tra i pulsanti su mobile */
  .btn-group-sm {
    gap: 3px;
  }
}

/* Hide text in buttons on mobile devices */
@media (max-width: 768px) {
  .website-header .btn span,
  .d-flex.justify-content-between h1 + .btn span,
  .d-flex.justify-content-between h5 + .btn span,
  .card-header .btn span {
    display: none;
  }
  
  /* Make buttons square and centered */
  .website-header .btn,
  .d-flex.justify-content-between h1 + .btn,
  .d-flex.justify-content-between h5 + .btn,
  .card-header .btn {
    width: 38px;
    height: 38px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  
  /* Ensure icons are properly centered */
  .website-header .btn i,
  .d-flex.justify-content-between .btn i,
  .card-header .btn i {
    margin: 0;
    font-size: 1rem;
  }
  
  /* Make sure all header elements align properly */
  .website-header .d-flex {
    flex-wrap: nowrap;
  }
  
  /* Keep the URL display from wrapping awkwardly */
  .website-header a.text-decoration-none {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 170px;
    display: inline-block;
  }
  
  /* Add a little space between buttons */
  .website-header .btn + .btn,
  .d-flex.justify-content-between .btn + .btn {
    margin-left: 5px;
  }
}