:root {
  --sidebar-width: 260px;
  --topbar-height: 60px;
  --primary-color: #0d6efd;
  --transition-speed: 0.25s;
}

[data-bs-theme="dark"] {
  --body-bg: #0f172a;
  --card-bg: #1e293b;
  --sidebar-bg: #111827;
  --border-color: #334155;
  --text-muted-color: #94a3b8;
}

[data-bs-theme="light"] {
  --body-bg: #f8fafc;
  --card-bg: #ffffff;
  --sidebar-bg: #ffffff;
  --border-color: #e2e8f0;
  --text-muted-color: #64748b;
}

body {
  background-color: var(--body-bg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--bs-body-color);
  transition: background-color var(--transition-speed) ease;
}

/* Sidebar */
#sidebar-wrapper {
  width: var(--sidebar-width);
  min-height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  background-color: var(--sidebar-bg);
  border-right: 1px solid var(--border-color);
  z-index: 1040;
  transition: transform var(--transition-speed) ease-in-out;
  display: flex;
  flex-direction: column;
}

.sidebar-heading {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  border-bottom: 1px solid var(--border-color);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.sidebar-nav {
  list-style: none;
  padding: 0.75rem 0.5rem;
  margin: 0;
  flex: 1;
  overflow-y: auto;
}

.sidebar-nav .nav-item {
  margin-bottom: 0.25rem;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  padding: 0.65rem 0.85rem;
  color: var(--bs-body-color);
  text-decoration: none;
  border-radius: 0.375rem;
  font-size: 0.925rem;
  font-weight: 500;
  transition: all 0.15s ease-in-out;
}

.sidebar-nav .nav-link i {
  font-size: 1.15rem;
  margin-right: 0.75rem;
  width: 20px;
  text-align: center;
}

.sidebar-nav .nav-link:hover {
  background-color: rgba(13, 110, 253, 0.08);
  color: var(--primary-color);
}

.sidebar-nav .nav-link.active {
  background-color: var(--primary-color);
  color: #ffffff !important;
}

.sidebar-nav .nav-header {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted-color);
  padding: 0.75rem 0.85rem 0.25rem;
}

/* Main Content Area */
#page-content-wrapper {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left var(--transition-speed) ease-in-out;
}

/* Top Navbar */
.top-navbar {
  height: var(--topbar-height);
  background-color: var(--sidebar-bg);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1030;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
}

/* Content Container */
.main-content {
  padding: 1.5rem;
  flex: 1;
}

/* Cards & Components */
.card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.stat-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.stat-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  font-size: 1.35rem;
}

.badge-tag {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
}

/* Responsive & Mobile Drawer */
@media (max-width: 991.98px) {
  #sidebar-wrapper {
    transform: translateX(-100%);
  }

  #sidebar-wrapper.show {
    transform: translateX(0);
    box-shadow: 4px 0 16px rgba(0, 0, 0, 0.25);
  }

  #page-content-wrapper {
    margin-left: 0;
  }

  .sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1039;
    display: none;
  }

  .sidebar-backdrop.show {
    display: block;
  }
}

/* Search Results Modal / Dropdown */
.search-result-item {
  display: flex;
  align-items: center;
  padding: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  text-decoration: none;
  color: var(--bs-body-color);
  border-radius: 0.375rem;
  cursor: pointer;
  transition: background-color 0.15s;
}

.search-result-item:hover {
  background-color: rgba(13, 110, 253, 0.06);
}

/* Toast container */
.toast-container {
  z-index: 1090;
}
