* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #f5f6fb;
  --sidebar-bg: #fff;
  --primary: #6366f1;
  --primary-soft: #eef2ff;
  --text: #1f2937;
  --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 0.3s ease;
  z-index: 1000;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* brand: logo upore, text niche */
.brand-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.brand-logo {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.brand-img {
  display: block;
  height: 40px;
  width: auto;
}

/* desktop/tablet: show logo.jpg */
.brand-img-desktop {
  display: block;
}

/* mobile: hidden by default */
.brand-img-mobile {
  display: none;
}

.brand h2 {
  font-size: 18px;
  color: var(--text);
}

.close-btn {
  margin-left: auto;
  background: none;
  border: none;
  font-size: 18px;
  display: none;
}

.menu {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* সব font same size, no underline */
.menu-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  border-radius: 8px;
  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: 28px;
  gap: 4px;
  margin-top: 4px;
}

.menu-group.open .submenu {
  display: flex;
}

.submenu a,
.submenu-link {
  display: block;
  padding: 8px 0;
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  border: none;
}

.submenu a:hover,
.submenu-link:hover,
.submenu a.active,
.submenu-link.active {
  color: var(--primary);
  background: none;
}

/* TOPBAR */
.topbar {
  height: 60px;
  background:var(--backgroundcol);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 900;
}

/* Desktop: margin-left for sidebar */
@media (min-width: 769px) {
  .topbar {
    margin-left: 250px;
    width: calc(100vw - 250px);
  }
}

.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 20px;
}

.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 + popup */
.avatar-wrapper {
  position: relative;
}

/* base avatar */
.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;
}

/* multi-color pulse ring */
.avatar-circle.multi-pulse::before,
.avatar-circle.multi-pulse::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid transparent;
  opacity: 0;
}

.avatar-circle.multi-pulse::before {
  border-color: rgba(23, 59, 104, 0.8); /* blue */
  animation: ringPulse1 1.8s ease-out infinite;
}

.avatar-circle.multi-pulse::after {
  border-color: rgba(94, 15, 56, 0.8); /* pink */
  animation: ringPulse2 2s ease-out infinite;
}

@keyframes ringPulse1 {
  0%   { transform: scale(0.9); opacity: 0.8; }
  70%  { transform: scale(1.5); opacity: 0; }
  100% { transform: scale(1.6); opacity: 0; }
}

@keyframes ringPulse2 {
  0%   { transform: scale(0.9); opacity: 0.6; }
  60%  { transform: scale(1.3); opacity: 0; }
  100% { transform: scale(1.5); opacity: 0; }
}

.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 {
  padding: 20px;
}

/* Desktop: content margin */
@media (min-width: 769px) {
  .content-wrapper {
    margin-left: 250px;
  }
}

/* Middle content styles (unchanged) */
.income-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
}

.income-table-card,
.income-form-card {
  background: #fff;
  padding: 16px;
  border-radius: 14px;
}

.income-table {
  width: 100%;
  border-collapse: collapse;
}

.income-table th,
.income-table td {
  padding: 10px;
  border-bottom: 1px solid #e5e7eb;
}

.income-table-header {
  font-weight: 600;
  margin-bottom: 10px;
}

.income-form-card input {
  width: 100%;
  height: 36px;
  margin-bottom: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 0 10px;
}

.income-form-card label {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
}

.primary-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
}

/* RESPONSIVE - TABLET */
@media (max-width: 1024px) and (min-width: 769px) {
  .income-layout {
    grid-template-columns: 1.5fr 1fr;
  }
}

/* RESPONSIVE - MOBILE */
@media (max-width: 768px) {
  .sidebar {
    left: -260px;
  }
  
  .sidebar.open {
    left: 0;
  }
  
  .hamburger {
    display: block;
  }
  
  .close-btn {
    display: block;
  }
  
  /* Mobile: full width header */
  .topbar {
    margin-left: 0 !important;
    width: 100vw !important;
    padding: 0 12px;
    left: 0;
    position: fixed;
  }
  
  .content-wrapper {
    margin-left: 0;
    padding: 75px 15px 20px;
  }
  
  .income-layout {
    grid-template-columns: 1fr;
  }
  
  .profile-popup {
    right: -10px;
  }

  /* mobile: show favicon, hide big logo */
  .brand-img-desktop {
    display: none;
  }

  .brand-img-mobile {
    display: block;
    height: 32px;
  }

  .brand-stack {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* RESPONSIVE - SMALL MOBILE */
@media (max-width: 480px) {
  .company-name {
    display: none; /* T avatar visible, profile use korte parbe */
  }
  
  .topbar {
    padding: 0 10px;
  }
  
  .content-wrapper {
    padding: 70px 10px 15px;
  }
}
