/* ============================================================
   DogManager Pro — brand tokens (allinea pannello alla landing)
   Primary: #2563eb | Dark: #1d4ed8 | Navy: #0a1628
   ============================================================ */
:root {
  --dmp-primary: #2563eb;
  --dmp-primary-dark: #1d4ed8;
  --dmp-navy: #0a1628;
  --dmp-navy-mid: #0d2247;
  --bs-primary: #2563eb;
  --bs-primary-rgb: 37, 99, 235;
}

.bg-gradient-primary {
  background-color: var(--dmp-navy-mid) !important;
  background-image: linear-gradient(180deg, #2563eb 10%, #0a1628 100%) !important;
}

.bg-primary,
.badge.bg-primary,
.btn-primary {
  --bs-btn-bg: #2563eb;
  --bs-btn-border-color: #2563eb;
  --bs-btn-hover-bg: #1d4ed8;
  --bs-btn-hover-border-color: #1d4ed8;
  --bs-btn-active-bg: #1e40af;
  --bs-btn-active-border-color: #1e40af;
  background-color: #2563eb !important;
  border-color: #2563eb !important;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: #1d4ed8 !important;
  border-color: #1d4ed8 !important;
}

.text-primary { color: #2563eb !important; }
.border-left-primary { border-left: 0.25rem solid #2563eb !important; }

.sidebar-dark .nav-item .nav-link:hover,
.sidebar-dark .nav-item .nav-link.active {
  color: #fff;
}

/* Topbar quiet icons */
.topbar .nav-link.dmp-topbar-btn {
  color: #475569 !important;
  background: transparent !important;
  border-radius: 8px;
  padding: 0.4rem 0.65rem !important;
  transition: background .15s, color .15s;
}
.topbar .nav-link.dmp-topbar-btn:hover {
  background: #f1f5f9 !important;
  color: #2563eb !important;
}
.topbar #pwa-header-btn.dmp-topbar-btn {
  color: #2563eb !important;
  border: 1px solid #bfdbfe;
  background: #eff6ff !important;
  box-shadow: none !important;
  font-weight: 600;
  border-radius: 8px;
}
.topbar #pwa-header-btn.dmp-topbar-btn:hover {
  background: #dbeafe !important;
}

.m-0 {
  margin: 0 !important;
}

.mx-1 {
  margin-right: .25rem !important;
  margin-left: .25rem !important;
}

.my-0 {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

.my-2 {
  margin-top: .5rem !important;
  margin-bottom: .5rem !important;
}

.my-5 {
  margin-top: 3rem !important;
  margin-bottom: 3rem !important;
}

.my-auto {
  margin-top: auto !important;
  margin-bottom: auto !important;
}

.mt-2 {
  margin-top: .5rem !important;
}

.mt-4 {
  margin-top: 1.5rem !important;
}

.me-2 {
  margin-right: .5rem !important;
}

.me-3 {
  margin-right: 1rem !important;
}

.me-auto {
  margin-right: auto !important;
}

.mb-0 {
  margin-bottom: 0 !important;
}

.mb-1 {
  margin-bottom: .25rem !important;
}

.mb-2 {
  margin-bottom: .5rem !important;
}

.mb-3 {
  margin-bottom: 1rem !important;
}

.mb-4 {
  margin-bottom: 1.5rem !important;
}

.mb-5 {
  margin-bottom: 3rem !important;
}

.ms-auto {
  margin-left: auto !important;
}

@media (min-width: 768px) {
  .my-md-0 {
    margin-top: 0rem !important;
    margin-bottom: 0rem !important;
  }
}

@media (min-width: 768px) {
  .ms-md-3 {
    margin-left: 1rem !important;
  }
}

/* Menu Sidebar Improvements */
.sidebar {
  width: 14rem;
  transition: width 0.3s ease;
}

.sidebar.toggled {
  width: 5rem;
}

.sidebar .nav-link {
  position: relative;
  display: flex !important;
  align-items: center;
  padding: 1rem;
  transition: all 0.3s ease;
  white-space: normal; /* Permette il wrap del testo */
  word-wrap: break-word;
}

.sidebar .nav-link i {
  font-size: 1.2rem;
  min-width: 2rem;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.75rem;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.sidebar .nav-link span {
  transition: opacity 0.3s ease;
  overflow: visible;
  flex: 1;
  line-height: 1.3;
}

.sidebar.toggled .nav-link {
  justify-content: center;
  padding: 1rem 0.5rem;
  flex-direction: column;
  text-align: center;
}

.sidebar.toggled .nav-link i {
  font-size: 1.5rem;
  margin-right: 0;
  margin-bottom: 0.25rem;
  width: 100%;
}

.sidebar.toggled .nav-link span {
  opacity: 1;
  font-size: 0.65rem;
  display: block;
  width: 100%;
  line-height: 1.2;
  margin-top: 0.25rem;
}

.sidebar.toggled .sidebar-brand {
  height: 0;
  overflow: hidden;
  padding: 0 !important;
  margin: 0 !important;
  opacity: 0;
}

.sidebar.toggled .sidebar-brand-icon {
  display: none !important;
}

.sidebar.toggled .dropdown-toggle::after {
  display: none;
}


.sidebar .dropdown-menu {
  background-color: rgba(255, 255, 255, 0.98);
  border: none;
  box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
  border-radius: 0.35rem;
  margin-top: 0.25rem;
  max-width: calc(14rem - 2rem); /* Larghezza sidebar meno padding */
  width: 100%;
}

.sidebar .nav-item.dropdown {
  position: relative;
}

.sidebar .dropdown-item {
  color: #5a5c69;
  padding: 0.5rem 1rem;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  white-space: normal;
  word-wrap: break-word;
  font-size: 0.85rem;
  line-height: 1.3;
}

.sidebar .dropdown-item i {
  min-width: 1.5rem;
  width: 1.5rem;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.sidebar .dropdown-item:hover {
  background-color: #4e73df;
  color: white;
  padding-left: 1.2rem;
}

.sidebar .dropdown-item:hover i {
  transform: scale(1.1);
}

/* Icon styling */
.nav-link i {
  color: rgba(255, 255, 255, 0.8);
}

.nav-link.active i,
.nav-link:hover i {
  color: rgba(255, 255, 255, 1);
  transform: scale(1.15);
}

.nav-link.active {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 0.35rem;
}

/* Sidebar brand adjustments */
.sidebar .sidebar-brand {
  transition: all 0.3s ease;
  overflow: hidden;
}

/* Dropdown in collapsed state */
.sidebar.toggled .dropdown-menu {
  position: absolute;
  left: 100%;
  top: 0;
  margin-left: 0.5rem;
  min-width: 200px;
}

.sidebar.toggled .nav-item.dropdown {
  position: relative;
}

.sidebar.toggled .nav-item.dropdown:hover .dropdown-menu {
  display: block;
}

/* Smooth transitions */
.sidebar * {
  transition: all 0.3s ease;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .sidebar {
    width: 14rem;
  }

  .sidebar.toggled {
    width: 0;
    overflow: hidden;
  }

  .sidebar .nav-link.active {
    margin: 0 0.25rem;
    width: calc(100% - 0.5rem);
    border-radius: 0.35rem;
    box-sizing: border-box;
  }
}

/* Additional styling for better UX */
#sidebarToggle {
  width: 2.5rem;
  height: 2.5rem;
  background-color: rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

#sidebarToggle:hover {
  background-color: rgba(255, 255, 255, 0.3);
  transform: rotate(180deg);
}

/* Improve dropdown arrow animation */
.sidebar .dropdown-toggle::after {
  transition: transform 0.3s ease;
}

.sidebar .dropdown.show .dropdown-toggle::after {
  transform: rotate(-180deg);
}

/* Add subtle shadow to active nav items */
.sidebar .nav-link.active {
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2);
  margin: 0 0.35rem;
  width: calc(100% - 0.7rem);
  border-radius: 0.35rem;
  box-sizing: border-box;
}

/* Smooth scrollbar for sidebar */
.sidebar {
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.5);
}

/* Animate content wrapper when sidebar toggles */
#content-wrapper {
  transition: margin-left 0.3s ease;
}

body.sidebar-toggled #content-wrapper {
  margin-left: 0;
}

/* Fix sidebar overflow issues */
.sidebar {
  overflow-x: hidden;
}

.sidebar .navbar-nav {
  width: 100%;
}

.sidebar .nav-item {
  width: 100%;
}

/* Ensure content doesn't overflow sidebar width */
.sidebar .nav-link {
  max-width: 100%;
  overflow: hidden;
}

/* Better spacing for sidebar items */
.sidebar .nav-item {
  margin-bottom: 0.25rem;
}

