/* =========================================
   1. VARIABLES & ROOT
   ========================================= */
:root {
  --primary-brand: #00aeef;
  --primary-hover: #0098d1;
  --primary-soft: rgba(0, 174, 239, 0.1);
  --text-dark: #2c3e50;
  --text-muted: #6c757d;
  --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #eef2f5 100%);
  --shadow-soft: 0 10px 40px -10px rgba(0, 0, 0, 0.08);
  --shadow-card: 0 15px 35px rgba(0, 0, 0, 0.05);
  --shadow-hover: 0 20px 50px -10px rgba(0, 174, 239, 0.15);
  --danger-color: #dc3545;
  --success-color: #198754;
  --excel-color: #107c41;
  /* alert */
  --bg-alert-full-msg: #f1f1f1;
  --color-alert-full-msg: #aaa9a9;
  --bg-alert-success: #00a20f;
  --color-alert-high-contrast-success: #ffffff;
  --bg-alert-error: #db0000;
  --color-alert-high-contrast-error: #ffffff;
  --bg-alert-warning: #e0942a;
  --color-alert-high-contrast-warning: #ffffff;
}

/* =========================================
   2. BASE STYLES & TYPOGRAPHY
   ========================================= */
body {
  font-family: "Titillium Web", sans-serif;
  background: var(--bg-gradient);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text-dark);
  margin: 0;
}

a {
  text-decoration: none;
  color: var(--primary-brand);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 300;
}

.fw-semi {
  font-weight: 600;
}

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

.welcome-text {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
}

.app-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  max-width: 700px;
  margin: 0 auto;
  font-weight: 600;
}

.form-section-title {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--primary-brand);
  font-weight: 700;
  margin: 2rem 0 1.5rem 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e9ecef;
}

/* =========================================
   3. LAYOUT & CONTAINERS
   ========================================= */
.main-content {
  /* Fondamentale per far espandere il contenuto */
  flex-grow: 1;
  /* Abilita Flexbox per centrare il contenuto interno */
  display: flex;
  flex-direction: column;
  /* Centratura verticale (Asse principale) */
  /* justify-content: center; */
  /* Centratura orizzontale (Asse trasversale) */
  /* align-items: center; */
  padding: 0 2rem;
  padding-top: 1rem;
  padding-bottom: 40px;
  margin: 0 auto !important;
  text-align: center !important;
}

.auth-nav {
  padding: 1.5rem 0;
  /* margin-bottom: 2rem; */
}

.flag-navbar {
  font-size: 1.2em;
}

.separator-line {
  height: 3px;
  width: 60px;
  background-color: var(--primary-brand);
  margin: 2rem auto;
  border-radius: 2px;
  opacity: 0.8;
}

/* =========================================
   4. LOGOS & IMAGES
   ========================================= */
.logo-dashboard {
  height: 45px;
  width: auto;
  transition: height 0.3s ease;
}
.logo-container {
  text-align: center;
  margin-bottom: 5rem;
  position: relative;
}

.logo-placeholder {
  max-width: 320px;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.05));
  transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
  margin-bottom: 0;
  display: inline-block;
}

.logo-placeholder:hover {
  transform: scale(1.03);
  filter: drop-shadow(0 10px 20px rgba(0, 174, 239, 0.1));
}

.logo-small {
  height: 70px;
  width: auto;
  transition: transform 0.3s ease;
}

.logo-small:hover {
  transform: scale(1.05);
}

/* =========================================
   5. BUTTONS & LINKS
   ========================================= */
.btn-brand {
  background-color: var(--primary-brand);
  border: 2px solid var(--primary-brand);
  color: white;
  font-weight: 600;
  padding: 0.6rem 1.5rem;
  letter-spacing: 0.5px;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.btn-brand:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 174, 239, 0.3);
}

.btn-outline-brand {
  background-color: transparent;
  color: var(--primary-brand);
  border: 2px solid var(--primary-brand);
  font-weight: 600;
  padding: 0.6rem 1.5rem;
  letter-spacing: 0.5px;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.btn-outline-brand:hover {
  background-color: var(--primary-brand);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 174, 239, 0.2);
}
.btn-outline-danger {
  background-color: transparent;
  color: var(--danger-color);
  border: 2px solid var(--danger-color);
  font-weight: 600;
  padding: 0.6rem 1.5rem;
  letter-spacing: 0.5px;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.btn-outline-danger:hover {
  background-color: var(--danger-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 174, 239, 0.2);
}

.btn-link-back {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color 0.2s;
}

.btn-link-back:hover {
  color: var(--primary-brand);
}

.forgot-pass-link {
  color: var(--primary-brand);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
  font-weight: 600;
}

.forgot-pass-link:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* =========================================
   6. FORMS & INPUTS
   ========================================= */
.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
  color: var(--primary-brand);
  transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem);
  z-index: 10;
}

.form-floating > label {
  z-index: 10;
}

.form-control:focus {
  border-color: var(--primary-brand);
  box-shadow: 0 0 0 0.25rem var(--primary-soft);
}

.form-check-input:checked {
  background-color: var(--primary-brand);
  border-color: var(--primary-brand);
}

.password-meter {
  height: 3px;
  background: #e9ecef;
  margin-top: 5px;
  border-radius: 2px;
  overflow: hidden;
}

.password-meter-bar {
  height: 100%;
  width: 0;
  background: var(--primary-brand);
  transition: width 0.3s ease;
}

.password-toggle .form-control {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.password-toggle .btn {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-color: var(--primary-brand);
  background-color: var(--primary-brand);
  color: #ffffff;
}

.password-toggle .btn:hover {
  border-color: var(--primary-hover);
  background-color: var(--primary-hover);
  color: #ffffff;
}

.password-toggle .btn:focus {
  box-shadow: none;
}

/***************************
CSS PER LA SELECT
****************************/
.select2-container .select2-selection--single {
  box-sizing: border-box;
  cursor: pointer;
  display: block;
  height: calc(3.5rem + calc(var(--bs-border-width) * 2));
  min-height: calc(3.5rem + calc(var(--bs-border-width) * 2));
  user-select: none;
  -webkit-user-select: none;
  text-align: left;
  padding-left: 0.75rem;
}
.select2-container--default
  .select2-selection--single
  .select2-selection__rendered {
  color: #444;
  line-height: calc(3.5rem + calc(var(--bs-border-width) * 2)) !important;
}

.bg-secondary-select2 {
  background: lightgray;
  display: block;
  padding: 6px;
  font-size: 16px;
}
/*Serve per la X della select 2*/
.select2-container--default
  .select2-selection--single
  .select2-selection__clear {
  cursor: pointer;
  float: right;
  font-weight: bold;
  height: calc(3.5rem + calc(var(--bs-border-width) * 2));
  min-height: calc(3.5rem + calc(var(--bs-border-width) * 2));
  margin-right: 20px;
  padding-right: 0px;
}
.select2-container--default .select2-selection--single {
  border: 1px solid #ced4da !important;
}
.select2-container--default
  .select2-selection--single
  .select2-selection__placeholder {
  color: #212529 !important;
}
.select2-container--default
  .select2-selection--single
  .select2-selection__arrow {
  height: calc(3.5rem + calc(var(--bs-border-width) * 2));
  min-height: calc(3.5rem + calc(var(--bs-border-width) * 2));
}
.select2-container--default
  .select2-results__option--highlighted.select2-results__option--selectable {
  background-color: var(--primary-brand);
  color: white;
}

.border-custom-danger {
  border: 1px solid var(--danger-color) !important;
}

.form-floating > .form-control-plaintext ~ label,
.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label,
.form-floating > .form-select ~ label {
  color: var(--primary-brand);
}

.form-floating
  .select2-container
  .select2-selection--single
  .select2-selection__rendered {
  margin-top: 6px !important;
}

/* =========================================
   7. CARDS (Login, Register, Action)
   ========================================= */
.register-card,
.login-card {
  background: white;
  border: none;
  border-radius: 20px;
  box-shadow: var(--shadow-card);
  margin-bottom: 2rem;
  animation: fadeInUp 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.register-card {
  padding: 3rem;
}
.login-card {
  padding: 3.5rem 3rem;
}

.action-card {
  border: none;
  border-bottom: 4px solid transparent;
  border-radius: 20px;
  background: white;
  text-align: center;
  padding: 3rem 2rem;
  height: 100%;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1),
    border-bottom 0.3s ease;
}

.action-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
  border-bottom-color: var(--primary-brand);
}

.card-title {
  font-weight: 600;
  font-size: 1.75rem;
  margin-bottom: 1rem;
  color: var(--text-dark);
}

.card-text {
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  font-size: 1rem;
  line-height: 1.6;
}

/* Icons inside cards */
.icon-wrapper {
  width: 90px;
  height: 90px;
  background-color: var(--primary-soft);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 2rem auto;
  transition: all 0.3s ease;
}

.icon-wrapper i {
  font-size: 2.5rem;
  color: var(--primary-brand);
  transition: transform 0.3s ease;
}

.action-card:hover .icon-wrapper {
  background-color: var(--primary-brand);
  transform: scale(1.1);
}

.action-card:hover .icon-wrapper i {
  color: white;
  transform: scale(0.9);
}

/* =========================================
   7. CARDS (Page Specific Logic)
   ========================================= */
.event-card {
  background: white;
  border: none;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: all 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
  border-bottom: 4px solid transparent;
}
.event-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
  border-bottom-color: var(--primary-brand);
}

.event-img-container {
  position: relative;
  height: 180px;
  overflow: hidden;
  background-color: #e9ecef;
}
.event-img-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.event-card:hover .event-img-container img {
  transform: scale(1.05);
}

.event-date-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(4px);
  padding: 5px 12px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-dark);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  z-index: 2;
}

.card-body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.event-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
}
.event-location {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 5px;
}

.stats-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  background: #f8f9fa;
  border-radius: 12px;
  padding: 0.8rem;
}
.stat-item {
  text-align: center;
  flex: 1;
}
.stat-item:first-child {
  border-right: 1px solid #dee2e6;
}
.stat-value {
  display: block;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-dark);
}
.stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 1px;
}

.progress-event {
  height: 4px;
  width: 100%;
  background: #e9ecef;
  margin-top: 5px;
  border-radius: 2px;
}

.card-actions {
  margin-top: auto;
  display: flex;
  gap: 10px;
}

/* Action Buttons inside Card */
.btn-view {
  flex: 2;
  background-color: var(--primary-brand);
  color: white;
  border: none;
  font-weight: 600;
  border-radius: 50px;
  padding: 0.6rem;
  transition: all 0.3s ease;
}
.btn-view:hover {
  background-color: var(--primary-hover);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 174, 239, 0.2);
}

.btn-delete {
  flex: 1;
  border: 1px solid var(--danger-color);
  color: var(--danger-color);
  background: transparent;
  font-weight: 600;
  border-radius: 50px;
  padding: 0.6rem;
  transition: all 0.2s;
}
.btn-delete:hover {
  background-color: var(--danger-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(220, 53, 69, 0.2);
}

/* =========================================
   8. LANGUAGE SELECTOR
   ========================================= */
.lang-switch-container {
  position: absolute;
  top: 25px;
  right: 30px;
  z-index: 1050;
}

.btn-lang {
  border: 1px solid rgba(0, 174, 239, 0.2);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  padding: 0.6rem 1.2rem 0.6rem 1.2rem;
  border-radius: 50px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-dark);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  max-width: 250px;
}

.btn-lang:hover,
.btn-lang.show {
  border-color: var(--primary-brand);
  background: white;
  box-shadow: 0 5px 15px rgba(0, 174, 239, 0.15);
  transform: translateY(-1px);
}

.btn-lang i {
  font-size: 1.1rem;
}

.dropdown-menu {
  border: none;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
  border-radius: 16px;
  padding: 0.6rem;
  z-index: 1055;
  min-width: 180px;
  /* Positioning overrides */
  position: absolute;
  top: 120% !important;
  right: 0 !important;
  left: auto !important;
  transform: none !important;
  margin-top: 0 !important;
  animation: fadeInDown 0.3s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
  transform-origin: top right;
}

.dropdown-item {
  border-radius: 10px;
  padding: 0.8rem 1rem;
  cursor: pointer;
  font-weight: 500;
  color: var(--text-dark);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 2px;
}

.dropdown-item:last-child {
  margin-bottom: 0;
}

.dropdown-item:hover {
  background-color: var(--primary-soft);
  color: var(--primary-brand);
  transform: translateX(4px);
}

.dropdown-item:active,
.dropdown-item.active {
  background-color: var(--primary-brand);
  color: white;
}

/* =========================================
   9. FOOTER
   ========================================= */
.footer {
  background: var(--bg-gradient);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  padding: 2rem 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  display: flex;
  justify-content: center;
  gap: 1rem;
  align-items: center;
  height: 42px !important;
}

.footer a {
  color: var(--text-dark);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.footer a:hover {
  color: var(--primary-brand);
}

/* =========================================
   10. ANIMATIONS
   ========================================= */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =========================================
   11. RESPONSIVE (Mobile)
   ========================================= */
@media (max-width: 767.98px) {
  /* Compact Navbar */
  .auth-nav {
    padding: 1rem 0;
    margin-bottom: 1.5rem;
  }

  /* Resize Logo */
  .logo-small {
    height: 45px; /* Smaller for mobile */
  }

  /* IMPROVED MOBILE BACK BUTTON: Circle Style */
  .btn-link-back {
    padding: 0;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: none;
  }

  .btn-link-back span {
    display: none; /* Hide text */
  }

  .btn-link-back i {
    font-size: 1.3rem;
    color: var(--primary-brand);
    margin: 0 0 0 10px;
    transform: none !important; /* Reset hover animation for touch */
  }

  .btn-link-back:active {
    transform: scale(0.95); /* Touch feedback */
  }

  /* Compact Language Button */
  .btn-lang {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
  }

  /* Card Padding adjustment */
  .login-card,
  .register-card {
    padding: 2rem 1.5rem; /* Less side padding on mobile */
    border-radius: 16px;
  }

  /* Reduce main logo size in index page */
  .logo-placeholder {
    max-width: 220px;
  }

  .logo-container {
    margin-bottom: 3rem;
  }

  .app-subtitle {
    font-size: 0.9rem;
    letter-spacing: 1px;
  }

  .main-content {
    padding: 1rem;
    /* CHIAVE: Disabilita la centratura verticale, allineando in alto */
    justify-content: flex-start;
    /* Manteniamo l'allineamento orizzontale al centro (se non specificato diversamente in align-items) */
    align-items: center;
    padding-top: 2rem;
  }
}

.dashboard-nav {
  padding: 0.8rem 0;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  transition: all 0.3s ease;
}

.dashboard-spacer {
  height: 80px;
}

.action-card.primary {
  background: linear-gradient(145deg, #ffffff 0%, #f0f9ff 100%);
  border: 1px solid rgba(0, 174, 239, 0.1);
}

.action-card.primary:hover {
  border-bottom-color: var(--primary-hover);
}

/* Admin/User Pill Button */
.btn-nav-pill {
  border: 1px solid rgba(0, 174, 239, 0.2);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  padding: 0.3rem 1.2rem 0.3rem 0.3rem;
  border-radius: 50px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-dark);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  max-width: 250px;
}

.btn-nav-pill:hover,
.btn-nav-pill.show {
  border-color: var(--primary-brand);
  background: white;
  box-shadow: 0 5px 15px rgba(0, 174, 239, 0.15);
  transform: translateY(-1px);
}

.btn-nav-pill img.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary-brand);
}

.agency-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Dropdowns */
.dropdown-toggle::after {
  display: none;
}

.dropdown-menu {
  border: none;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  border-radius: 16px;
  padding: 0.5rem;
  z-index: 1055;

  /* Positioning overrides */
  min-width: 350px;
  position: absolute;
  top: 100% !important; /* Esattamente sotto */
  right: 0 !important;
  left: auto !important;
  transform: none !important;
  margin-top: 15px !important; /* Spazio visivo */

  animation: fadeInDown 0.3s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
}
.drop-down-lang {
  min-width: 150px;
}

.dropdown-header {
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 1px;
  padding: 0.5rem 1rem;
}

.dropdown-item {
  border-radius: 10px;
  padding: 0.7rem 1rem;
  cursor: pointer;
  font-weight: 500;
  color: var(--text-dark);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 10px; /* Icona e testo vicini */
  margin-bottom: 2px;
}

.dropdown-item:last-child {
  margin-bottom: 0;
}

.dropdown-item:hover {
  background-color: var(--primary-soft);
  color: var(--primary-brand);
  transform: translateX(4px);
}

.dropdown-item:active,
.dropdown-item.active {
  background-color: var(--primary-brand);
  color: white;
}

/* User Menu Specifics */
.user-info-header {
  padding: 1.5rem 1rem;
  text-align: center;
}
.user-info-header img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin-bottom: 0.8rem;
  border: 3px solid var(--primary-brand);
  padding: 3px;
  background: white;
}

.user-info-header .profile-picture-container {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto 0.8rem auto;
  border: 3px solid var(--primary-brand);
  background: white;
  display: flex;
  justify-content: center;
  align-items: center;
}
.profile-picture {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: var(--primary-brand);
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  font-size: 1.5rem;
  font-weight: bold;
}

.profile-picture-small {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary-brand);
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  font-size: 1rem;
  font-weight: bold;
}

.credits-box {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 1.2rem;
  margin: 0.5rem;
  border: 1px solid #e9ecef;
}
.progress-slim {
  height: 8px;
  background-color: #e9ecef;
  border-radius: 4px;
  margin-top: 8px;
  overflow: hidden;
}
.progress-bar-brand {
  background-color: var(--primary-brand);
}

/* =========================================
           8. NAVIGATION ELEMENTS (Pills, Menus)
           ========================================= */
/* Nav Pills */
.btn-nav-pill {
  border: 1px solid rgba(0, 174, 239, 0.2);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  padding: 0.3rem 1.2rem 0.3rem 0.3rem;
  border-radius: 50px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}
.btn-nav-pill:hover {
  background: white;
  border-color: var(--primary-brand);
  transform: translateY(-1px);
  box-shadow: 0 5px 15px rgba(0, 174, 239, 0.15);
}

.btn-nav-pill img.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary-brand);
}
.agency-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

.btn-context-menu {
  padding: 0.4rem 1.2rem;
  color: var(--primary-brand);
}

/* Dropdowns */
.dropdown-toggle::after {
  display: none;
}
.dropdown-menu {
  border: none;
  background: #ffffff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  border-radius: 16px;
  padding: 0.5rem;
  z-index: 1055;
  position: absolute;
  top: 100% !important;
  margin-top: 15px !important;
  transform: none !important;
  animation: fadeInDown 0.3s ease forwards;
}

/* Desktop Positioning */
@media (min-width: 992px) {
  #userDropdown + .dropdown-menu {
    min-width: 380px;
    right: 0 !important;
    left: auto !important;
  }
  #contextMenu + .dropdown-menu {
    min-width: 260px;
    left: 0 !important;
    right: auto !important;
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown-item {
  border-radius: 10px;
  padding: 0.7rem 1rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s;
  color: var(--text-dark);
}
.dropdown-item:hover {
  background-color: var(--primary-soft);
  color: var(--primary-brand);
  transform: translateX(4px);
}
.dropdown-header {
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 1px;
  padding: 0.5rem 1rem;
}

/* User Menu Content */
.user-info-header {
  padding: 1.5rem 1rem;
  text-align: center;
}
.user-info-header img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin-bottom: 0.8rem;
  border: 3px solid var(--primary-brand);
  padding: 3px;
  background: white;
}
.credits-box {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 1.2rem;
  margin: 0.5rem;
  border: 1px solid #e9ecef;
}
.progress-slim {
  height: 8px;
  background-color: #e9ecef;
  border-radius: 4px;
  overflow: hidden;
}
.progress-bar-brand {
  background-color: var(--primary-brand);
}

/* =========================================
           10. TABLET SPECIFIC (768px - 991.98px)
           ========================================= */
@media (min-width: 768px) and (max-width: 991.98px) {
  .dashboard-spacer {
    /* margin-top: 80px; */
    margin-top: auto;
  }
  /* Optimize Grid: allow cards to breathe */
  .row.g-4 {
    --bs-gutter-x: 1rem;
  }

  /* Compact Navbar Elements */
  .dashboard-nav .container {
    padding: 0 1rem;
    max-width: 100%;
  }
  .dashboard-nav .d-flex.gap-3 {
    gap: 0.5rem !important;
  }

  /* Circular "Acquista Crediti" Button (Icon Only) */
  .btn-buy-credits {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50% !important;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .btn-buy-credits span {
    display: none;
  }
  .btn-buy-credits i {
    margin-right: 0 !important;
    font-size: 1.2rem;
  }

  /* Shrink Agency Name width */
  .agency-name {
    max-width: 100px;
    font-size: 0.85rem;
  }
  .btn-nav-pill {
    padding: 0.3rem 0.8rem 0.3rem 0.3rem;
    font-size: 0.85rem;
  }

  /* Dropdown Positioning for Tablet */
  #userDropdown + .dropdown-menu {
    min-width: 320px;
    right: 0 !important;
    left: auto !important;
  }
}

/* =========================================
           11. MOBILE SPECIFIC (< 767.98px)
           ========================================= */
@media (max-width: 767.98px) {
  /* Force content spacing */
  .dashboard-spacer {
    /* margin-top: 50px; */
    margin-top: auto;
  }

  /* Navbar Sizing */
  .dashboard-nav {
    padding: 0.6rem 0;
  }
  .logo-dashboard {
    height: 35px;
  }
  .dashboard-nav .d-flex.gap-3 {
    gap: 0.6rem !important;
  }

  /* Circular Buttons Mobile */
  .btn-buy-credits {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50% !important;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .btn-buy-credits span {
    display: none;
  }
  .btn-buy-credits i {
    margin-right: 0 !important;
    font-size: 1.2rem;
  }

  .btn-nav-pill {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    justify-content: center;
  }
  .btn-nav-pill .agency-name {
    display: none;
  }
  .btn-nav-pill img.avatar {
    width: 100%;
    height: 100%;
    border: 2px solid var(--primary-brand);
    padding: 1px;
  }

  .btn-context-menu {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .btn-context-menu span {
    display: none;
  }
  .btn-context-menu i {
    margin-right: 0 !important;
    font-size: 1.2rem;
  }

  /* Full Width Mobile Dropdown Sheets */
  .dropdown-menu {
    position: fixed !important;
    top: 65px !important;
    left: 10px !important;
    right: 10px !important;
    width: auto !important;
    min-width: 0 !important;
    margin-top: 0 !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-height: 80vh;
    overflow-y: auto;
  }

  /* Layout Tweaks */
  .card-actions {
    flex-direction: column;
  }
  .btn-delete {
    width: 100%;
  }
  /* .input-group {
    display: none;
  } */
}

/* Container per gli input OTP */
.otp-inputs {
  display: flex;
  justify-content: center; /* centra gli input */
  gap: 10px; /* spazio tra gli input */
}

/* Stile degli input OTP */
.otp-inputs input {
  width: 50px; /* larghezza del rettangolo */
  height: 50px; /* altezza del rettangolo */
  text-align: center; /* centra il numero digitato */
  font-size: 1.5rem; /* dimensione del numero */
  border: 2px solid #ccc; /* bordo di default */
  border-radius: 8px; /* angoli arrotondati */
  outline: none; /* rimuove il bordo di default al focus */
  transition: border-color 0.3s, box-shadow 0.3s;
}

/* Effetto al focus */
.otp-inputs input:focus {
  border-color: var(--primary-brand); /* cambia colore bordo */
  box-shadow: 0 0 5px var(--primary-brand); /* effetto glow */
}

/* Disabilita la selezione del testo */
.otp-inputs input::selection {
  background: transparent;
}

@media (max-width: 400px) {
  /* Stile degli input OTP */
  .otp-inputs input {
    width: 40px; /* larghezza del rettangolo */
    height: 40px; /* altezza del rettangolo */
  }
}

/* registrazione ok */
.box-istruzioni {
  background-color: #f0f8ff;
  padding: 20px;
  border-radius: 6px;
  border-left: 5px solid var(--primary-brand);
  margin-bottom: 30px;
}

/* Container per l'icona, posizionato in alto a destra del campo */
.feedback-container {
  pointer-events: none; /* Rende il div trasparente ai click */
  width: auto; /* Adatta alla larghezza del contenuto */
}

/* Stile per l'icona di successo */
.feedback-success {
  color: #28a745; /* Verde Bootstrap */
}

/* Stile per l'icona e il box di errore */
.feedback-error {
  color: #dc3545; /* Rosso Bootstrap */
  padding: 5px 8px;
  background-color: #f8d7da; /* Sfondo chiaro per il box di errore */
  border: 1px solid #f5c6cb;
  border-radius: 5px;
}

/*************************************
INIZIO TOAST CUSTOM
**************************************/
.toast {
  position: fixed;
  top: 20px;
  right: 5px;
  z-index: 99999999999;
}

/*************************************
INIZIO ALERT CUSTOM
**************************************/
.alert {
  margin: 0;
  padding: 6px 16px;
  border: 0;
  font-size: 13px;
  border-radius: 6px;
}
.alert-full-msg {
  background-color: var(--bg-alert-full-msg);
  padding: 40px 20px;
  border-radius: var(--bs-border-radius);
  color: var(--color-alert-full-msg);
}

.alert-success-custom {
  background-color: var(--bg-alert-success);
  color: var(--color-alert-high-contrast-success);
}

.alert-error-custom {
  background-color: var(--bg-alert-error);
  color: var(--color-alert-high-contrast-error);
}

.alert-warning-custom {
  background-color: var(--bg-alert-warning);
  color: var(--color-alert-high-contrast-warning);
}

/* ===== PAGINAZIONE APPOINTMENTS ===== */
.mini-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}

.mini-btn {
  border: 1px solid var(--primary-brand);
  background: transparent;
  color: var(--primary-brand);
  padding: 6px 10px;
  font-size: 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.2s;
}

.mini-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.mini-btn:hover:not(:disabled) {
  background: var(--primary-brand);
  color: #fff;
}

.mini-label {
  font-size: 0.95rem;
  color: #444;
  white-space: nowrap;
}

/* Mobile */
@media (max-width: 575px) {
  .mini-pagination {
    gap: 8px;
  }
  .mini-btn {
    padding: 5px 8px;
    font-size: 0.9rem;
  }
  .mini-label {
    font-size: 0.85rem;
  }
}
