:root {
  --sidebar-width: 280px;
  --sidebar-bg: #111827;
  /* Very dark blue/gray */
  --sidebar-text: #9ca3af;
  --sidebar-active-bg: #1f2937;
  --sidebar-active-text: #ffffff;
  --accent-color: #3b82f6;
  /* Modern Blue */
  --topbar-height: 64px;
}

body {
  background-color: #f3f4f6;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
}

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

/* Sidebar Styling */
#sidebar-wrapper {
  min-width: var(--sidebar-width);
  max-width: var(--sidebar-width);
  background-color: var(--sidebar-bg);
  color: #fff;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  z-index: 1000;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.1);
}

.sidebar-brand {
  height: auto;
  min-height: var(--topbar-height);
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding: 0.75rem 1rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  text-decoration: none;
}

.sidebar-content {
  padding: 1rem 0;
  overflow-y: auto;
  flex-grow: 1;
}

/* Navigation Items */
.nav-section-label {
  padding: 1.5rem 1.5rem 0.5rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
  font-weight: 600;
}

.nav-link {
  color: var(--sidebar-text);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  font-weight: 500;
  transition: all 0.2s;
  border-left: 3px solid transparent;
  font-size: 0.95rem;
}

.nav-link:hover {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
  color: var(--sidebar-active-text);
  background-color: var(--sidebar-active-bg);
  border-left-color: var(--accent-color);
}

.nav-link i {
  margin-right: 0.75rem;
  font-size: 1.1rem;
  opacity: 0.8;
}

/* Submenu/Collapse styling */
.sidebar-submenu .nav-link {
  padding-left: 3.5rem;
  font-size: 0.9rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.sidebar-submenu .nav-link.active {
  background: transparent;
  color: var(--accent-color);
  border-left-color: transparent;
}


/* Dropdown arrow rotation */
.nav-link[data-bs-toggle="collapse"]::after {
  content: "\F282";
  /* Bootstrap Icon chevron-down */
  font-family: "bootstrap-icons";
  margin-left: auto;
  font-size: 0.8rem;
  transition: transform 0.2s;
}

.nav-link[data-bs-toggle="collapse"][aria-expanded="true"]::after {
  transform: rotate(-180deg);
}


/* Main Content Area */
#page-content-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Topbar */
.topbar {
  height: var(--topbar-height);
  padding: 0 2rem;
  background: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e5e7eb;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Tenant Pill in Topbar */
.tenant-selector {
  display: flex;
  align-items: center;
  background: #f3f4f6;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  border: 1px solid #e5e7eb;
}

/* Responsive Toggles */
@media (max-width: 991.98px) {
  #sidebar-wrapper {
    margin-left: calc(-1 * var(--sidebar-width));
    position: fixed;
    height: 100%;
  }

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

  #wrapper.toggled::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
  }
}

/* Main Content Padding */
main.container-fluid {
  padding-top: 2rem;
  padding-bottom: 2rem;
  max-width: 1600px;
}

/* Global Search in Topbar */
.topbar-search {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  max-width: 320px;
  /* Slightly wider */
  width: 100%;
  margin-left: 0;
}

.topbar-search input {
  width: 100%;
  padding: 0.5rem 1rem 0.5rem 2.5rem;
  border-radius: 9999px;
  border: 1px solid #e5e7eb;
  background-color: #f9fafb;
  font-size: 0.875rem;
  transition: all 0.2s;
}

.topbar-search input:focus {
  background-color: #fff;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  outline: none;
}


.topbar-search i {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  pointer-events: none;
  font-size: 0.8rem;
}

/* Icon Buttons in Topbar */
.btn-icon {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #6b7280;
  transition: all 0.2s;
  background: transparent;
  border: none;
  font-size: 1.1rem;
}

.btn-icon:hover {
  background-color: #f3f4f6;
  color: #111827;
}

.btn-icon.has-notification {
  position: relative;
}

.btn-icon.has-notification::after {
  content: "";
  position: absolute;
  top: 0.75rem;
  /* Ajusted for new size */
  right: 0.75rem;
  width: 8px;
  height: 8px;
  background-color: #ef4444;
  border-radius: 50%;
  border: 1px solid #fff;
}

/* Wiki / General Content Tweaks */
.wiki-content blockquote {
    border-left: 4px solid #e5e7eb;
    padding-left: 1rem;
    color: #4b5563;
    font-style: italic;
    margin-left: 0;
    margin-right: 0;
}