* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #f5f6fb;
  --sidebar-bg: #fff;
  --primary: #6366f1;
  --primary-soft: #eef2ff;
  --text: #1f2933;
 --muted: #000000;
  --backgroundcol: #d1a5ee;
}

body {
  font-family: Poppins, sans-serif;
  background: var(--bg);
}

/* SIDEBAR */
.sidebar {
  width: 250px;
  height: 100vh;
  background: var(--backgroundcol);
  position: fixed;
  left: 0;
  top: 0;
  padding: 16px;
  border-right: 1px solid #e5e7eb;
  transition: left .3s ease;
  z-index: 1000;
}

.sidebar-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

/* brand vertical stack */
.brand-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  flex-grow: 1;
}

.brand-logo {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.brand-img {
  display: block;
  height: 40px;
  width: auto;
}

.brand-img-desktop {
  display: block;
}

.brand-img-mobile {
  display: none;
}

.brand h2 {
  font-size: 18px;
  color: var(--text);
}

.close-btn {
  background: none;
  border: none;
  font-size: 18px;
  display: none;
}

/* MENU */
.menu {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.menu-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 8px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}

.menu-link i {
  font-size: 16px;
}

.menu-link:hover,
.menu-link.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.menu-group .submenu {
  display: none;
  flex-direction: column;
  padding-left: 30px;
  gap: 4px;
  margin-top: 4px;
}

.menu-group.open .submenu {
  display: flex;
}

.submenu-link {
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  padding: 6px 0;
}

.submenu-link:hover,
.submenu-link.active {
  color: var(--primary);
}

/* TOPBAR */
.topbar {
  height: 60px;
  background: var(--backgroundcol);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e5e7eb;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 900;
  padding: 0 20px;
}

/* DESKTOP - Sidebar offset */
@media (min-width: 769px) {
  .topbar {
    padding: 0 20px;
    margin-left: 250px;
    width: calc(100% - 250px);
  }
}

.hamburger {
  display: none;
  font-size: 20px;
  background: none;
  border: none;
}

.topbar-title {
  font-size: 14px;
  color: #6b7280;
  white-space: nowrap;
}

.topbar-title .current {
  color: #111827;
  font-weight: 500;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.company-name {
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
}

/* Avatar + multi-color pulse animation */
.avatar-wrapper {
  position: relative;
}

.avatar-circle {
  width: 32px;
  height: 32px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.avatar-circle.multi-pulse {
  box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.7);
  animation: multiPulse 2s infinite;
}

.avatar-circle.multi-pulse::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, 
    rgba(99, 102, 241, 0.4), 
    rgba(96, 165, 250, 0.4), 
    rgba(248, 113, 113, 0.4), 
    rgba(34, 197, 94, 0.4), 
    rgba(251, 191, 36, 0.4));
  animation: rotateGlow 3s linear infinite;
  border-radius: 50%;
}

@keyframes multiPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(99, 102, 241, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
  }
}

@keyframes rotateGlow {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.avatar-circle.small {
  width: 28px;
  height: 28px;
  font-size: 13px;
}

.profile-popup {
  position: absolute;
  right: 0;
  top: 40px;
  width: 220px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(15,23,42,0.18);
  padding: 12px;
  display: none;
  animation: fadeIn 0.18s ease-out;
  z-index: 1001;
}

.profile-popup.open {
  display: block;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e5e7eb;
}

.profile-info {
  font-size: 12px;
}

.profile-name {
  font-weight: 600;
  color: #111827;
}

.profile-email {
  color: #6b7280;
}

.profile-menu {
  list-style: none;
  margin-top: 8px;
}

.profile-menu li a {
  display: block;
  padding: 6px 4px;
  font-size: 13px;
  color: #374151;
  text-decoration: none;
  border-radius: 6px;
}

.profile-menu li a:hover {
  background: #f3f4ff;
  color: var(--primary);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* CONTENT WRAPPER */
.content-wrapper {
  padding: 80px 20px 20px;
  min-height: 100vh;
}

/* DESKTOP */
@media (min-width: 769px) {
  .content-wrapper {
    margin-left: 250px;
  }
}

/* MIDDLE CONTENT (UNCHANGED) */
.main {
  padding: 20px;
}

.card {
  background: #fff;
  padding: 15px;
  border-radius: 10px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn {
  background: #4f46e5;
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
}

.filters {
  display: flex;
  gap: 10px;
  margin: 15px 0;
}

.filters input, .filters select {
  padding: 6px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
}

.table-responsive {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 10px;
  border-bottom: 1px solid #ddd;
  text-align: left;
}

.status.active {
  background: #16a34a;
  color: #fff;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
}

/* MOBILE */
@media (max-width: 768px) {
  .sidebar {
    left: -260px;
  }

  .sidebar.open {
    left: 0;
  }

  .hamburger {
    display: block;
  }

  .close-btn {
    display: block;
  }

  .topbar {
    padding: 0 12px;
  }

  .content-wrapper {
    padding: 80px 15px 20px;
    margin-left: 0;
  }

  /* mobile logo switch */
  .brand-img-desktop {
    display: none;
  }

  .brand-img-mobile {
    display: block;
    height: 32px;
  }
}

/* SMALL MOBILE */
@media (max-width: 479px) {
  .company-name {
    display: none;
  }

  .topbar {
    padding: 0 10px;
  }

  .topbar-title {
    font-size: 13px;
  }

  .content-wrapper {
    padding: 75px 10px 15px;
  }

  .profile-popup {
    right: 0;
    width: 180px;
  }

  .filters {
    flex-direction: column;
  }
}
