/* Stili base necessari per il menu */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --success: #059669;
  --danger: #dc2626;
  --warning: #d97706;
  --info: #0891b2;
  --sidebar-bg: #1e293b;
  --sidebar-hover: #334155;
  --card-border: rgba(0, 0, 0, 0.05);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: #f8fafc;
}

.wrapper {
  display: flex;
  width: 100%;
  align-items: stretch;
  min-height: 100vh;
}

/* Sidebar Styles */
#sidebar {
  min-width: 280px;
  max-width: 280px;
  background: var(--sidebar-bg);
  color: #fff;
  transition: all 0.3s;
  z-index: 1000;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow: auto;
  padding-bottom: 8rem;
}

.modal.fade {
  z-index: 9999999 !important;
}

.logo-container a {
  text-decoration: none;
}

.logo {
  background: url(./images/rifiuto_smart_color_logo.png) no-repeat;
  display: inline-block;
  height: 60px;
  width: 100%;
  background-size: contain;
}

.logo-white {
  background: url(./images/rifiuto_smart_white_logo.png) no-repeat;
  background-size: contain;
}

.admin-welcome {
  font-size: 0.9rem;
  color: #e2e8f0;
  margin-bottom: 0;
  padding: 0;
}

.logo-guest {
  display: block;
  height: 80px;
  width: 60px;
  margin: -80px auto 60px;
}

.logo-mobile {
  width: 40px;
  margin-left: 10px;
}

#sidebar .sidebar-header {
  padding: 1.5rem;
  background: var(--sidebar-bg);
  border-bottom: 1px solid var(--sidebar-hover);
}

#sidebar .sidebar-header h3 {
  margin: 0;
  color: white;
  font-size: 1.45rem;
}

#sidebar ul.components {
  padding: 1rem 0;
  list-style: none;
  margin: 0;
}

#sidebar ul li {
  padding: 0;
}

#sidebar ul li a {
  padding: 1rem 1.5rem;
  font-size: 1rem;
  display: flex;
  align-items: center;
  color: #e2e8f0;
  text-decoration: none;
  transition: all 0.3s;
  border-left: 4px solid transparent;
}

#sidebar ul li a .menu-icon {
  margin-right: 1rem;
  font-size: 1.25rem;
  width: 24px;
  text-align: center;
}

#sidebar ul li a:hover {
  background: var(--sidebar-hover);
  border-left-color: var(--primary);
  color: white;
}

#sidebar ul li.active>a {
  background: var(--sidebar-hover);
  border-left-color: var(--primary);
  color: white;
}

/* Content Styles */
#content {
  width: 100%;
  padding: 0;
  /*min-height: 100vh;*/
  transition: all 0.3s;
  background-color: #f8fafc;
  margin-bottom: 4.5rem;
}

/* Footer Styles */
.footer {
  background-color: var(--sidebar-bg);
  color: #e2e8f0;
  padding: 10px;
  /*margin-bottom: 2rem;*/
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 99999;
  font-size: 14px;
  font-family: sans-serif;
  box-sizing: border-box;
}

.footer h5 {
  color: white;
  font-weight: 600;
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a,
.footer a {
  color: #e2e8f0;
  text-decoration: none;
  transition: color 0.3s;
}

.footer-links a:hover,
.footer a:hover {
  color: white;
  text-decoration: underline;
}

.footer-bottom {
  border-top: 1px solid var(--sidebar-hover);
  padding-top: 1rem;
  margin-top: 1rem;
  font-size: 0.875rem;
}

.social-icons a {
  color: #e2e8f0;
  font-size: 1.25rem;
  margin-right: 1rem;
  transition: color 0.3s;
}

.social-icons a:hover {
  color: white;
}

/* Responsive */
@media (max-width: 768px) {

  #sidebar {
    margin-left: -280px;
    position: fixed;
    height: 100%;
    z-index: 1050;
    box-shadow: none;
    transition: all 0.3s ease-in-out;
  }

  #sidebar.active {
    margin-left: 0;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
  }

  #content {
    width: 100%;
    padding-left: 0;
    transition: all 0.3s;
  }

  /* Miglioramenti per tabelle responsive */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Miglioramenti per card statistiche */
  .stat-card {
    margin-bottom: 15px;
  }

  /* Miglioramenti per form e filtri */
  .card .row>[class*="col-"] {
    margin-bottom: 15px;
  }

  /* Miglioramenti per bottoni e azioni */
  .btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.9rem;
  }

  /* Miglioramenti per titoli */
  h2 {
    font-size: 1.5rem;
  }

  /* Miglioramenti per grafici */
  canvas {
    max-width: 100%;
    height: auto !important;
  }

  /* Miglioramenti per modali */
  .modal-dialog {
    margin: 0.5rem;
  }

  /* Miglioramenti per navbar */
  .navbar h2 {
    font-size: 1.2rem;
  }

  /* Miglioramenti per timeline */
  .timeline-item {
    padding-left: 0;
  }
}

.frm_rovito_municipal label {
  display: block;
}

.frm_rovito_municipal .select2-container .select2-selection--single,
.frm_rovito_municipal .select2-container .select2-selection--multiple {
  height: 46px !important;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 0.5rem;
}

.frm_rovito_municipal .select2-selection__rendered {
  line-height: 46px !important;
}

.frm_rovito_municipal .select2-selection__arrow {
  height: 46px !important;
}

.frm_rovito_municipal .select2-container--default .select2-selection--single .select2-selection__clear {
  height: 42px;
  margin-right: 30px;
}

.filters-bar .select2-container .select2-selection--single {
  height: 38px !important;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 0.375rem;
}

.filters-bar .select2-selection__rendered {
  line-height: 38px !important;
}

.filters-bar .select2-selection__arrow {
  height: 38px !important;
}

.frm_rovito_municipal .select2-container--default .select2-selection--multiple {
  padding: 0.25rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.frm_rovito_municipal .select2-container--default .select2-selection--multiple .select2-selection__choice,
.frm_rovito_municipal .select2-container--default .select2-selection--multiple .select2-selection__rendered {
  line-height: 24px !important;
}

.ajax-button {
  /* Basic button styling */
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  position: relative;
  /* For positioning the loader */
  overflow: hidden;
  /* Hide overflowing loader */
}

.ajax-button .loader {
  display: none;
  /* Hidden by default */
  /* Basic loader styling (e.g., a spinner) */
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.ajax-button.loading {
  /* Style when loading */
  background-color: #555;
  /* Dimmed background */
  cursor: not-allowed;
  pointer-events: none;
  /* Disable clicks */
}

.ajax-button.loading .text {
  visibility: hidden;
}

.ajax-button.loading .loader {
  display: block;
  /* Show loader when loading */
}

/* Keyframe animation for the spinner */
@keyframes spin {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }

  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.badge.clm,
.badge.completato,
.badge.da-vuotare,
.badge.informazione {
  background-color: rgba(var(--bs-primary-rgb), var(--bs-bg-opacity)) !important;
}

.badge.clv {
  background-color: rgba(var(--bs-warning-rgb), var(--bs-bg-opacity)) !important;
}

.badge.clc,
.badge.con-segnalazione,
.badge.in-manutenzione,
.badge.assigned {
  background: linear-gradient(135deg, var(--warning), var(--warning));
}

.badge.da-sostituire,
.badge.disabled {
  background: linear-gradient(135deg, var(--danger), var(--danger)) !important;
}

.badge.servizio {
  background-color: rgba(var(--bs-secondary-rgb), var(--bs-bg-opacity)) !important;
}

.badge.evento {
  background-color: var(--info) !important;
}

#existing_invoice_file {
  display: block;
  margin: 5px;
}

.btn-outline-danger.ajax-button {
  border: 1px solid;
}

.btn-outline-danger.ajax-button:hover {
  border: none;
}

@media print {
  @page {
    size: auto;
    margin: 0mm auto;
  }

  body {
    padding: 1.6cm;
  }
}

@media (min-width: 320px) {
  #sidebarCollapse {
    visibility: visible;
    width: auto;
    background: var(--sidebar-bg);
    width: 50px;
    height: 50px;
    padding: 0px;
  }

  .desktop-footer {
    display: none;
  }

  .mobile-footer {
    display: block;
    font-size: 10px;
  }

  .logo-guest {
    display: block;
    height: 60px;
    width: 40px;
    margin: -100px auto 40px;
  }

  /*
  .mobile-footer span {
    font-size: 14px;
    line-height: 12px;
  }
    */
}

@media (min-width: 768px) {
  #sidebarCollapse {
    visibility: hidden;
  }

  .desktop-footer {
    display: block;
  }

  .mobile-footer {
    display: none;
  }

  .logo-guest {
    display: block;
    height: 80px;
    width: 60px;
    margin: -80px auto 60px;
  }
}