/* RESET */
* {
  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;
}

/* BASE */
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 vertical stack like logo over text */
.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 logo */
.brand-img-desktop {
  display: block;
}

/* mobile favicon (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 */

.menu {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* সব menu-link + submenu same size, no border */
.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 {
  border: none;
  outline: none;
}

.menu-group .submenu {
  display: none;
  flex-direction: column;
  padding-left: 30px;
  gap: 4px;
  margin-top: 4px;
  border: none;
  outline: none;
}

.menu-group .submenu a {
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  border: none;
}

.menu-group.open .submenu {
  display: flex;
}

.submenu a:hover {
  background: #f3f4ff;
  color: var(--primary);
}

/* ============ TOPBAR ============ */

.topbar {
  height: 60px;
  background:var(--backgroundcol);
  margin-left: 250px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 900;
  width: calc(100% - 250px);
  box-sizing: border-box;
}

.hamburger {
  display: none;
  font-size: 20px;
  background: none;
  border: none;
}

.topbar-title {
  font-size: 14px;
  color: #6b7280;
}

.topbar-title .current {
  color: #111827;
  font-weight: 500;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.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;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
}

/* multi-color layered pulse animation */
.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(96, 165, 250, 0.9);   /* blue */
  animation: ringPulse1 1.7s ease-out infinite;
}

.avatar-circle.multi-pulse::after {
  border-color: rgba(248, 113, 113, 0.9);  /* red/orange */
  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;
}

.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 {
  margin-left: 250px;
  padding: 16px 20px 24px;
  background: var(--bg);
  min-height: calc(100vh - 60px);
  box-sizing: border-box;
}

.income-page {
  max-width: 1280px;
  margin: 0 auto;
}

.income-layout {
  display: grid;
  grid-template-columns: 2.1fr 0.9fr;
  gap: 18px;
}

/* LEFT TABLE CARD */

.income-table-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
  padding: 18px 18px 14px;
}

.income-table-header {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 10px;
}

.income-table-scroll {
  width: 100%;
  overflow-x: auto;
}

.income-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.income-table thead {
  background: #f9fafb;
}

.income-table th,
.income-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
}

.income-table th {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: #6b7280;
}

.income-table td {
  color: #374151;
}

/* RIGHT FORM CARD */

.income-form-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
  padding: 18px 18px 16px;
}

.income-form-title {
  font-size: 16px;
  color: #111827;
  margin-bottom: 12px;
}

.income-form-group {
  margin-bottom: 10px;
}

.income-form-group label {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
  color: #374151;
}

.required {
  color: #ef4444;
}

.income-form-group input {
  width: 100%;
  height: 38px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  padding: 0 10px;
  font-size: 13px;
  outline: none;
}

.income-form-group input:focus {
  border-color: var(--primary);
}

.income-form-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-start;
}

.primary-btn {
  background: #4f46e5;
  border: none;
  color: #fff;
  padding: 9px 22px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
}

/* ============ RESPONSIVE ============ */

@media (max-width: 1024px) {
  .income-layout {
    grid-template-columns: 1.6fr 1fr;
  }
}

@media (max-width: 768px) {
  /* sidebar behaviour */
  .sidebar {
    left: -260px;
  }

  .sidebar.open {
    left: 0;
  }

  .hamburger {
    display: block;
  }

  .close-btn {
    display: block;
  }

  .topbar {
    margin-left: 0;
    width: 100%;
    padding: 0 12px;
  }

  .content-wrapper {
    margin-left: 0;
    padding: 12px 12px 18px;
  }

  .income-layout {
    grid-template-columns: 1fr;
  }

  .profile-popup {
    right: -20px;
  }

  /* 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;
  }
}

@media (max-width: 480px) {
  .income-table th,
  .income-table td {
    padding: 8px 8px;
  }

  /* very small screen: hide company name, keep avatar T visible */
  .company-name {
    display: none;
  }
}
