/* =================================
   APM Bootstrap 5 Sidebar Navigation
   Material Design 3 Compliant
   ================================= */

/* =================================
   1. CSS Variables
   ================================= */
:root {
  /* Sidebar */
  /* Sidebar Modern Theme */
  --sidebar-width: 280px;
  --sidebar-bg: #103e5e;
  /* Deep Premium Blue */
  --sidebar-gradient: linear-gradient(180deg, #103e5e 0%, #0a273d 100%);
  --sidebar-text: #e2e8f0;
  /* Slate-200 for better contrast */
  --sidebar-hover: rgba(255, 255, 255, 0.08);
  --sidebar-active: rgba(255, 255, 255, 0.15);
  --sidebar-active-text: #ffffff;
  --sidebar-pill-radius: 12px;

  /* Topbar */
  --topbar-height: 83px;
  /* Match sidebar-header: 16px + 50px logo + 16px + 1px border */
  --topbar-bg: #ffffff;
  --topbar-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  /* MD3 elevation level 2 */

  /* Content */
  --content-bg: aliceblue;

  /* Transitions */
  --transition-speed: 0.3s;

  /* Z-index layers */
  --z-sidebar: 1040;
  --z-topbar: 1030;
  --z-offcanvas: 1045;
}

/* =================================
   2. Layout Structure
   ================================= */
.wrapper {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

#sidebar {
  min-width: var(--sidebar-width);
  max-width: var(--sidebar-width);
  background: var(--sidebar-gradient);
  color: var(--sidebar-text);
  transition: all var(--transition-speed) ease;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: var(--z-sidebar);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#content {
  width: calc(100% - var(--sidebar-width));
  /* Breedte = viewport - sidebar */
  min-height: 100vh;
  transition: all var(--transition-speed) ease;
  margin-left: var(--sidebar-width);
  background: var(--content-bg);
  box-sizing: border-box;
  /* Zorg dat padding/borders binnen width blijven */
  overflow-x: clip;
  /* Voorkom horizontale scroll zonder sticky te breken */
}

/* =================================
   3. Sidebar Components
   ================================= */
.sidebar-header {
  height: 83px;
  /* Match topbar height exactly */
  padding: 0 1rem;
  /* Horizontal padding only */
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: #ffffff;
  /* White background for logo */
  flex-shrink: 0;
  /* MD3 elevation level 2 - subtle shadow to match topbar */
  box-shadow: none;
  /* Cleaner look without shadow */
  background: rgba(0, 0, 0, 0.2);
  /* Darker header for contrast with logo */
  backdrop-filter: blur(10px);
}

.sidebar-header img {
  max-width: 180px;
  height: 45px;
  /* Slightly smaller for elegance */
  object-fit: contain;
  /* Maintain aspect ratio */
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.sidebar-content {
  padding: 1rem 0;
  height: calc(100vh - 83px);
  /* Explicit height: full viewport minus header */
  overflow-y: auto;
  overflow-x: hidden;
  /* Thin scrollbar styling */
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
  /* Flex layout to push footer to bottom */
  display: flex;
  flex-direction: column;
  scrollbar-gutter: stable;
  /* Voorkom layout shift bij scrollbar */
}

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

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

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

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

/* Menu Groups */
.sidebar-section {
  margin-bottom: 2rem;
  /* Vergroot van 1.5rem naar 2rem voor meer witruimte */
}

.sidebar-section-title {
  padding: 0.5rem 1.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 0.5rem;
}

/* Menu Items - TOPLEVEL */
.sidebar-nav-link {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  margin: 0.25rem 1rem;
  width: calc(100% - 2rem);
  /* Explicit width to ensure consistency */
  color: var(--sidebar-text);
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: var(--sidebar-pill-radius);
  position: relative;
  overflow: hidden;
  font-size: 0.95rem;
  font-weight: 500;
  border-left: none;
  /* Remove old border style */
}

.sidebar-nav-link:hover {
  background: var(--sidebar-hover);
  color: #ffffff;
  text-decoration: none;
  transform: translateX(4px);
}

.sidebar-nav-link.active {
  background: var(--sidebar-active);
  color: var(--sidebar-active-text);
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-left: none;
}

.sidebar-nav-link i {
  font-size: 1.25rem;
  /* Slightly refined size */
  margin-right: 0.85rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
  opacity: 0.9;
  transition: transform 0.2s ease;
}

.sidebar-nav-link:hover i,
.sidebar-nav-link.active i {
  opacity: 1;
  transform: scale(1.1);
}

/* Collapsible Groups - Match toplevel styling */
.sidebar-collapse-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  margin: 0.25rem 1rem;
  width: calc(100% - 2rem);
  /* Explicit width to match nav links */
  color: var(--sidebar-text);
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
  font-size: 0.95rem;
  position: relative;
  overflow: hidden;
  border-radius: var(--sidebar-pill-radius);
  border-left: none;
}

.sidebar-collapse-toggle:hover {
  background: var(--sidebar-hover);
  color: #ffffff;
  transform: translateX(4px);
}

/* Expanded state */
.sidebar-collapse-toggle:not(.collapsed) {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}

.sidebar-collapse-toggle-content {
  display: flex;
  align-items: center;
}

.sidebar-collapse-toggle-content i {
  font-size: 1.4rem;
  /* Match toplevel icon size */
  margin-right: 0.75rem;
  width: 28px;
  /* Match toplevel icon width */
  text-align: center;
}

.sidebar-collapse-toggle i.bi-chevron-down {
  transition: transform 0.2s ease;
  font-size: 1rem;
  /* Slightly larger chevron */
  flex-shrink: 0;
}

.sidebar-collapse-toggle:not(.collapsed) i.bi-chevron-down {
  transform: rotate(180deg);
}

.sidebar-collapse {
  background: rgba(0, 0, 0, 0.15);
  /* Donkerder voor meer contrast */
  position: relative;
  /* Voor verticale lijn */
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
  /* Subtle depth effect */
  overflow: hidden;
  /* Fix margin collapse jump */
  padding: 0;
  /* Remove padding to fix collapse animation */
}

/* Verticale verbindingslijn voor sublevel items */
.sidebar-collapse::before {
  content: '';
  position: absolute;
  left: 2rem;
  /* Adjusted for new margins */
  top: 0.5rem;
  bottom: 0.5rem;
  width: 2px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 1px;
}

.sidebar-collapse .sidebar-nav-link {
  padding: 0.5rem 1rem 0.5rem 3.5rem;
  /* Indented padding */
  margin: 0 1rem 0.2rem 1rem;
  /* Adjusted margins: Top 0 to prevent collapse issues */
  width: calc(100% - 2rem);
  /* Smaller vertical margin for subitems */
  font-size: 0.9rem;
  font-weight: 500;
  /* Increased from 400 for better legibility */
  color: rgba(255, 255, 255, 0.7);
  border-left: none;
  border-radius: var(--sidebar-pill-radius);
}

.sidebar-collapse .sidebar-nav-link:first-child {
  margin-top: 0.25rem;
}

.sidebar-collapse .sidebar-nav-link:last-child {
  margin-bottom: 0.25rem;
}

/* Sublevel iconen kleiner maken */
.sidebar-collapse .sidebar-nav-link i {
  font-size: 0.9rem;
  width: 20px;
  margin-right: 0.5rem;
}

/* Sublevel hover */
.sidebar-collapse .sidebar-nav-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  transform: translateX(4px);
}

/* Sublevel active state */
.sidebar-collapse .sidebar-nav-link.active {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-weight: 500;
  box-shadow: none;
  /* No shadow for subitems to keep it clean */
}

/* =================================
   4. Topbar
   ================================= */
.topbar {
  height: var(--topbar-height);
  background: var(--topbar-bg);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: var(--topbar-shadow);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: var(--z-topbar);
}

.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #333;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.hamburger:hover {
  background: rgba(0, 0, 0, 0.05);
}

/* Search in topbar */
.topbar .search-container {
  flex: 1;
  max-width: 500px;
  margin: 0 2rem;
  position: relative;
}

.topbar .desktop-search {
  width: 100%;
}

.topbar .search-input {
  width: 100%;
  background: #f1f3f5;
  border: 2px solid #e0e4e8;
  border-radius: 24px;
  color: #2c3e50;
  padding: 0.625rem 1.25rem 0.625rem 2.75rem;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(27, 100, 148, 0.08);
}

.topbar .search-input:hover {
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(27, 100, 148, 0.12);
  transform: translateY(-1px);
}

.topbar .search-input:focus {
  outline: none;
  background: #ffffff;
  border-color: #1b6494;
  box-shadow: 0 4px 16px rgba(27, 100, 148, 0.2), 0 0 0 4px rgba(27, 100, 148, 0.1);
  transform: translateY(-1px);
}

.topbar .search-input::placeholder {
  color: #6c757d;
  font-weight: 400;
}

.topbar .search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #1b6494;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  pointer-events: none;
}

.topbar .desktop-search:has(.search-input:focus) .search-icon,
.topbar .desktop-search:has(.search-input:hover) .search-icon {
  color: #2c7ba0;
  transform: translateY(-50%) scale(1.1);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.topbar-actions .nav-link {
  color: #333;
  padding: 0.5rem;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.topbar-actions .nav-link:hover {
  background: rgba(0, 0, 0, 0.05);
  text-decoration: none;
}

/* User avatar in topbar */
.topbar .user-avatar {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: rgba(27, 100, 148, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1b6494;
  font-weight: 600;
  border: 2px solid rgba(27, 100, 148, 0.2);
  transition: all 0.2s ease;
}

.topbar .user-avatar:hover {
  background: rgba(27, 100, 148, 0.15);
  border-color: rgba(27, 100, 148, 0.3);
}

/* =================================
   5. Content Area
   ================================= */
.content-area {
  padding: 0 2rem 2rem 2rem;
  /* No top padding - dashboard-header sits flush against topbar */
  min-height: calc(100vh - var(--topbar-height));
}

/* Override base.html container padding for better spacing */
.content-area>.container,
.content-area>.container-fluid {
  padding-left: 0;
  padding-right: 0;
}

/* =================================
   6. Mobile Responsive (< 992px)
   ================================= */
@media (max-width: 991.98px) {

  /* Hide desktop sidebar */
  #sidebar {
    display: none;
  }

  /* Remove content margin and reset width to full viewport */
  #content {
    margin-left: 0;
    width: 100%;
    /* Op mobile geen sidebar, dus volle breedte */
  }

  /* Show hamburger */
  .hamburger {
    display: block;
  }

  /* Mobile offcanvas sidebar */
  .offcanvas-sidebar {
    background: var(--sidebar-gradient);
    width: var(--sidebar-width) !important;
    max-width: var(--sidebar-width) !important;
  }

  .offcanvas-sidebar .offcanvas-header {
    background: rgba(0, 0, 0, 0.1);
    color: var(--sidebar-text);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem 1rem;
  }

  .offcanvas-sidebar .btn-close {
    filter: brightness(0) invert(1);
  }

  .offcanvas-sidebar .offcanvas-body {
    padding: 0;
    overflow-x: hidden;
  }

  /* Adjust search in topbar for mobile */
  .topbar .search-container {
    display: none;
    /* Hide desktop search, use modal instead */
  }

  /* Reduce content padding on mobile */
  .content-area {
    padding: 0 1rem 1rem 1rem;
    /* No top padding on tablet */
  }
}

/* Medium devices (tablets) */
@media (max-width: 768px) {
  .content-area {
    padding: 0 0.75rem 0.75rem 0.75rem;
    /* No top padding on mobile */
  }

  .topbar {
    padding: 0 1rem;
  }
}

/* =================================
   7. Material Design 3 Enhancements
   ================================= */

/* Ripple effect for nav links */
.sidebar-nav-link::before,
.sidebar-collapse-toggle::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s;
  pointer-events: none;
}

.sidebar-nav-link:active::before,
.sidebar-collapse-toggle:active::before {
  width: 200px;
  height: 200px;
  transition: width 0s, height 0s;
}

/* Clean card shadows in content (MD3 style) */
.content-area .card {
  border: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.2s ease;
  border-radius: 12px;
}

.content-area .card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* =================================
   8. Dropdown Styling (Notifications, User)
   ================================= */

/* Ensure dropdowns appear correctly in topbar */
.topbar .dropdown-menu {
  border: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  border-radius: 12px;
  margin-top: 0.5rem;
}

/* =================================
   9. Search Dropdown in Topbar
   ================================= */

.topbar .search-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  width: 600px;
  min-width: 500px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0, 0, 0, 0.1);
  z-index: 1060;
  max-height: 70vh;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.topbar .search-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.topbar .search-dropdown-content {
  max-height: 70vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: #dee2e6 #f8f9fa;
}

.topbar .search-dropdown-content::-webkit-scrollbar {
  width: 6px;
}

.topbar .search-dropdown-content::-webkit-scrollbar-track {
  background: #f8f9fa;
}

.topbar .search-dropdown-content::-webkit-scrollbar-thumb {
  background-color: #dee2e6;
  border-radius: 6px;
}

.topbar .search-dropdown-content::-webkit-scrollbar-thumb:hover {
  background-color: #adb5bd;
}

/* Search Result Items */
.search-result-section {
  border-bottom: 1px solid #f0f0f0;
}

.search-result-section:last-child {
  border-bottom: none;
}

.search-result-header {
  background: #f8f9fa;
  padding: 0.75rem 1rem;
  font-weight: 600;
  font-size: 0.875rem;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #e9ecef;
}

.search-result-item {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: #495057;
  transition: all 0.2s ease;
  border-bottom: 1px solid #f8f9fa;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover,
.search-result-item:focus {
  background: #f8f9fa;
  color: #1b6494;
  text-decoration: none;
  transform: translateX(4px);
}

.search-result-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.75rem;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.search-result-icon.debiteuren {
  background: rgba(40, 167, 69, 0.1);
  color: #28a745;
}

.search-result-icon.offertes {
  background: rgba(0, 123, 255, 0.1);
  color: #007bff;
}

.search-result-icon.facturen {
  background: rgba(255, 193, 7, 0.1);
  color: #ffc107;
}

.search-result-icon.werkbonnen {
  background: rgba(220, 53, 69, 0.1);
  color: #dc3545;
}

.search-result-icon.leads {
  background: rgba(102, 16, 242, 0.1);
  color: #6610f2;
}

.search-result-content {
  flex: 1;
  min-width: 0;
}

.search-result-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.search-result-subtitle {
  font-size: 0.8rem;
  color: #6c757d;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Search Result Container voor werkbonnen met extra acties */
.search-result-item-container {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid #f8f9fa;
  transition: all 0.2s ease;
}

.search-result-item-container:last-child {
  border-bottom: none;
}

.search-result-item-container:hover {
  background: #f8f9fa;
}

.search-result-item-container .search-result-item {
  flex: 1;
  border-bottom: none;
  margin-bottom: 0;
  display: flex;
  align-items: center;
}

.search-result-item-container .search-result-item:hover {
  background: transparent;
  transform: none;
}

.search-result-actions {
  padding: 0.75rem;
  flex-shrink: 0;
}

.search-klantkaart-btn {
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-color: #1b6494;
  color: #1b6494;
  background-color: rgba(27, 100, 148, 0.05);
  transition: all 0.2s ease;
  white-space: nowrap;
  min-width: 80px;
  text-align: center;
}

.search-klantkaart-btn:hover {
  background-color: #1b6494;
  border-color: #1b6494;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(27, 100, 148, 0.25);
}

.search-klantkaart-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(27, 100, 148, 0.2);
}

.search-klantkaart-btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(27, 100, 148, 0.2);
}

.search-klantkaart-btn i {
  font-size: 1rem;
}

/* Search Loading and No Results */
.search-loading,
.search-no-results {
  padding: 1rem;
}

/* =================================
   9b. Notification Dropdown Styling
   ================================= */

.notification-dropdown {
  min-width: 400px;
  max-width: 450px;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 0;
}

.notification-header {
  background: rgba(248, 249, 250, 0.95);
  color: #495057;
  padding: 0.75rem 1rem;
  border-radius: 12px 12px 0 0;
  margin: 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.notification-header h6 {
  font-weight: 600;
  font-size: 1rem;
  margin: 0;
  color: #495057;
}

.notification-content {
  max-height: 450px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0;
  margin: 0;
  background: transparent;
}

#notification-list-container {
  padding: 0;
  margin: 0;
  background: white;
  border-radius: 0 0 16px 16px;
}

.notification-content::-webkit-scrollbar {
  width: 6px;
}

.notification-content::-webkit-scrollbar-track {
  background: #f8f9fa;
}

.notification-content::-webkit-scrollbar-thumb {
  background-color: #dee2e6;
  border-radius: 6px;
}

.notification-content::-webkit-scrollbar-thumb:hover {
  background-color: #adb5bd;
}

.notification-item {
  display: flex;
  align-items: flex-start;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
  position: relative;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.9);
  margin: 0;
  overflow-x: hidden;
}

.notification-item:hover {
  background: rgba(74, 144, 164, 0.08);
  text-decoration: none;
  color: inherit;
  transform: translateX(2px);
  border-left: 3px solid #4a90a4;
}

.notification-item:last-child {
  border-bottom: none;
}

.notification-item:first-child {
  border-radius: 0;
}

.notification-item.unread {
  background: linear-gradient(135deg, rgba(74, 144, 164, 0.12) 0%, rgba(74, 144, 164, 0.06) 100%);
  border-left: 3px solid #4a90a4;
  font-weight: 600;
}

.notification-item.unread::before {
  content: '';
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 10px;
  height: 10px;
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
  animation: pulse-notification 2s infinite;
}

@keyframes pulse-notification {
  0% {
    box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
  }

  70% {
    box-shadow: 0 0 0 6px rgba(220, 53, 69, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
  }
}

.notification-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.75rem;
  flex-shrink: 0;
  font-size: 1.1rem;
}

.notification-icon.success {
  background: rgba(40, 167, 69, 0.1);
  color: #28a745;
}

.notification-icon.info {
  background: rgba(23, 162, 184, 0.1);
  color: #17a2b8;
}

.notification-icon.warning {
  background: rgba(255, 193, 7, 0.1);
  color: #ffc107;
}

.notification-icon.danger {
  background: rgba(220, 53, 69, 0.1);
  color: #dc3545;
}

.notification-body {
  flex: 1;
  min-width: 0;
}

.notification-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
  line-height: 1.3;
}

.notification-message {
  font-size: 0.85rem;
  color: #6c757d;
  line-height: 1.4;
  margin-bottom: 0.25rem;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.notification-time {
  font-size: 0.75rem;
  color: #adb5bd;
}

.notification-footer {
  background: rgba(248, 249, 250, 0.95);
  border-radius: 0 0 12px 12px;
  padding: 0.75rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  margin: 0;
  display: flex;
  gap: 0.5rem;
}

.notification-footer .btn {
  flex: 1;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.2s ease;
  border: 1px solid rgba(74, 144, 164, 0.2);
  color: #4a90a4;
  background: white;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
}

.notification-footer .btn:hover {
  background: #4a90a4;
  color: white;
  border-color: #4a90a4;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(74, 144, 164, 0.2);
}

.notification-footer .btn i {
  font-size: 0.875rem;
}

.notification-empty {
  text-align: center;
  padding: 3rem 2rem;
  color: #6c757d;
  background: white;
  border-radius: 0 0 16px 16px;
  margin: 0;
}

.notification-empty i {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.4;
  color: #adb5bd;
}

.notification-empty div {
  font-size: 1rem;
  font-weight: 500;
}

/* =================================
   10. Mobile Search Button in Topbar
   ================================= */

.topbar .mobile-search-btn {
  display: none;
}

@media (max-width: 991.98px) {
  .topbar .mobile-search-btn {
    display: inline-block;
  }
}

/* =================================
   11. Utility Classes
   ================================= */

/* Hide on desktop, show on mobile */
.sidebar-mobile-only {
  display: none;
}

@media (max-width: 991.98px) {
  .sidebar-mobile-only {
    display: block;
  }
}

/* Show on desktop, hide on mobile */
.sidebar-desktop-only {
  display: block;
}

@media (max-width: 991.98px) {
  .sidebar-desktop-only {
    display: none;
  }
}

/* =================================
   12. Smooth Scrolling
   ================================= */

.sidebar-content,
.offcanvas-sidebar .offcanvas-body {
  scroll-behavior: smooth;
}

/* =================================
   13. Focus States for Accessibility
   ================================= */

.sidebar-nav-link:focus,
.sidebar-collapse-toggle:focus {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

/* Remove focus outline on mouse click, keep for keyboard */
.sidebar-nav-link:focus:not(:focus-visible),
.sidebar-collapse-toggle:focus:not(:focus-visible) {
  outline: none;
}

/* =================================
   14. Print Styles
   ================================= */

@media print {

  #sidebar,
  .topbar {
    display: none !important;
  }

  #content {
    margin-left: 0 !important;
  }

  .content-area {
    padding: 0 !important;
  }
}

/* =================================
   12. Sidebar Footer - Version & Changelog
   ================================= */
.sidebar-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-version-info {
  display: flex;
  flex-direction: column;
  padding: 0.5rem 1rem;
  text-align: center;
  gap: 0.25rem;
}

.version-number {
  font-family: 'Courier New', monospace;
  font-weight: 600;
  color: #3498db;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.95);
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  display: inline-block;
  margin: 0 auto;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
}

.version-number:hover {
  background: rgba(255, 255, 255, 1);
  color: #2980b9;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Mobile sidebar footer adjustments */
.offcanvas-sidebar .sidebar-footer {
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.offcanvas-sidebar .version-number {
  color: #1b6494;
  background: rgba(27, 100, 148, 0.1);
}

.offcanvas-sidebar .version-number:hover {
  background: rgba(27, 100, 148, 0.15);
  color: #154a75;
}