/* RESET */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #f5f6fb;
  --sidebar-bg: #fff;
  --primary: #6366f1;
  --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: center;
  justify-content: space-between;
  gap: 10px;
}

/* brand vertical stack for desktop/tablet */
.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 font, 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: #eef2ff;
  color: var(--primary);
}

.menu-group {
  border: none;
  outline: none;
}

.menu-group .submenu {
  display: none;
  flex-direction: column;
  padding-left: 30px;
  gap: 4px;
  border: none;
  outline: none;
}

.menu-group .submenu a {
  font-size: 14px;
  color: #4b5563;
  text-decoration: none;
  padding: 4px 0;
  border: none;
}

.menu-group.open .submenu {
  display: flex;
}

/* ================= 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 ring 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(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;
}

.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); }
}

/* ================= MAIN CONTENT WRAPPER ================= */

.content-wrapper {
  margin-left: 250px;
  padding: 16px 20px 24px;
  background: #f5f6fb;
  min-height: calc(100vh - 60px);
  box-sizing: border-box;
}

.cat-page {
  max-width: 1280px;
  margin: 0 auto;
}

/* breadcrumb */

.cat-breadcrumb {
  font-size: 13px;
  color: #9ca3af;
  margin-bottom: 14px;
}

.cat-breadcrumb span:last-child {
  color: #111827;
}

/* layout: left table + right form */

.cat-layout {
  display: grid;
  grid-template-columns: 2fr 1.1fr;
  gap: 16px;
}

/* cards */

.cat-table-card,
.cat-form-card {
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.06);
  padding: 16px 18px;
}

/* ===== TABLE SIDE ===== */

.cat-table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding: 4px 0;
  font-size: 13px;
  color: #4b5563;
}

.cat-show-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cat-show-select {
  height: 34px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  font-size: 13px;
  background: #fff;
  outline: none;
}

.cat-search-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #4b5563;
}

.cat-search-wrap label {
  white-space: nowrap;
}

.cat-search-wrap input {
  height: 34px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  font-size: 13px;
  outline: none;
  min-width: 160px;
}

.cat-search-wrap input:focus,
.cat-show-select:focus {
  border-color: #6366f1;
}

/* table */

.cat-table-scroll {
  width: 100%;
  overflow-x: auto;
}

.cat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.cat-table thead {
  background: #f9fafb;
}

.cat-table th,
.cat-table td {
  padding: 10px 10px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
}

.cat-table th {
  font-size: 11px;
  text-transform: uppercase;
  color: #6b7280;
  font-weight: 600;
}

.cat-table td {
  color: #374151;
}

.cat-img-cell {
  width: 46px;
  height: 46px;
  border-radius: 4px;
  border: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #6b7280;
  background: #f3f4f6;
}

.cat-status-badge {
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 11px;
  border: none;
  cursor: default;
}

.cat-status-active {
  background: #dcfce7;
  color: #15803d;
}

.cat-status-inactive {
  background: #fee2e2;
  color: #b91c1c;
}

.cat-action-btn {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #6b7280;
  font-size: 14px;
}

/* ===== FORM SIDE ===== */

.cat-form-title {
  font-size: 16px;
  margin-bottom: 12px;
  color: #111827;
}

.cat-form-group {
  margin-bottom: 12px;
}

.cat-form-group label {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
  color: #374151;
}

.cat-required {
  color: #ef4444;
}

.cat-form-group input,
.cat-form-group select,
.cat-form-group textarea {
  width: 100%;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  padding: 8px 10px;
  font-size: 13px;
  outline: none;
}

.cat-form-group input:focus,
.cat-form-group select:focus,
.cat-form-group textarea:focus {
  border-color: #6366f1;
}

/* image upload */

.cat-image-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.cat-file-label {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  font-size: 13px;
  color: #374151;
  cursor: pointer;
}

.cat-file-label input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.cat-file-text {
  font-size: 12px;
  color: #6b7280;
}

.cat-image-preview {
  width: 80px;
  height: 80px;
  border-radius: 4px;
  border: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #6b7280;
  background: #f9fafb;
}

/* editor */

.cat-editor-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.cat-font-select {
  height: 32px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  padding: 0 8px;
  font-size: 12px;
  outline: none;
}

.cat-editor-btn {
  width: 30px;
  height: 30px;
  border-radius: 4px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  cursor: pointer;
  font-size: 13px;
}

/* buttons */

.cat-form-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
}

.cat-btn {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  border: none;
  cursor: pointer;
}

.cat-btn-primary {
  background: #6366f1;
  color: #ffffff;
}

.cat-btn-outline {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  color: #374151;
}

/* ================ RESPONSIVE ================ */

@media (max-width: 1024px) {
  .cat-layout {
    grid-template-columns: 1.3fr 1fr;
  }
}

@media (max-width: 768px) {
  .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;
  }

  .cat-layout {
    grid-template-columns: 1fr;
  }

  .cat-form-card {
    order: 2;
  }

  .cat-table-card {
    order: 1;
  }

  .cat-table-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .cat-search-wrap input {
    min-width: 0;
    width: 100%;
  }

  .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) {
  .cat-table th,
  .cat-table td {
    padding: 8px 6px;
  }

  .cat-image-row {
    flex-direction: column;
    align-items: flex-start;
  }

  /* very small screens: hide company name, keep avatar */
  .company-name {
    display: none;
  }
}
