/* Base Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", sans-serif;
  background-color: #f3f4f6;
  color: #111827;
}

/* App Container */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 240px;
  background-color: #ffffff;
  border-right: 1px solid #e5e7eb;
  padding: 20px 16px;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1000;
  transition: left 0.3s ease;
  overflow-y: auto;
}


/* Hidden state */
.sidebar:not(.active) {
  left: -250px;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
}

.sidebar-logo img {
  width: 150px;
  /* height: 100px; */
}

.sidebar-title {
  font-size: 18px;
  font-weight: 600;
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
}

.sidebar-menu a {
  display: flex;
  align-items: center;
  padding: 12px;
  margin-bottom: 6px;
  text-decoration: none;
  color: #4b5563;
  border-radius: 6px;
  font-size: 15px;
  transition: background 0.2s;
  gap: 14px; /* 👈 Add this line for spacing between icon and text */
}


.sidebar-menu a i {
  margin-right: 10px;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
  background-color: #f3f4f6;
  color: #111827;
}

.menu-group {
  margin-bottom: 8px;
}

.submenu {
  list-style: none;
  margin-left: 25px;
  margin-top: 4px;
  display: none;
}

.menu-group.open .submenu {
  display: block;
}

.submenu li a {
  font-size: 14px;
  color: #6b7280;
  padding: 6px 8px;
  display: block;
  border-radius: 4px;
  transition: background 0.2s;
}

.submenu li a:hover {
  background-color: #f3f4f6;
  color: #111827;
}

.logout-btn {
  width: 100%;
  padding: 10px;
  margin-top: 40px;
  background-color: #10b981;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logout-btn i {
  margin-right: 8px;
}

/* Main Area */
.main-content {
  margin-left: 240px;
  width: 100%;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.topbar {
  height: 60px;
  background-color: #fff;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 900;
}

.topbar-left {
  display: flex;
  align-items: center;
}

.menu-toggle {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.lang-select {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #111;
}

.lang-select img {
  width: 18px;
  height: 18px;
}

.notifications {
  position: relative;
}

.notifications .badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background-color: red;
  color: white;
  border-radius: 50%;
  font-size: 10px;
  padding: 2px 5px;
}

.profile-pic img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
}

/* Page Content */
.content-area {
  padding: 20px;
}

/* Dashboard Cards */
.card-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 20px;
}

.card {
  flex: 1;
  background-color: #fff;
  border-radius: 8px;
  padding: 20px;
  min-width: 200px;
  box-shadow: 0 0 0 1px #e5e7eb;
}

.card h3 {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 6px;
}

.card .value {
  font-size: 20px;
  font-weight: 600;
}

/* Chart Section */
.chart-section {
  display: flex;
  gap: 20px;
  margin-top: 20px;
}

.chart-box {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  flex: 1;
  box-shadow: 0 0 0 1px #e5e7eb;
}

.chart-box h4 {
  font-size: 16px;
  margin-bottom: 10px;
}

/* Footer */
.footer-bar {
  background-color: #ffffff;
  border-top: 1px solid #e5e7eb;
  padding: 16px 24px;
  text-align: center;
  font-size: 14px;
  color: #6b7280;
  margin-top: auto;
}


/* Desktop: always visible */
@media (min-width: 769px) {
  .sidebar {
    left: 0 !important;
  }
}


#page-content {
  flex: 1;
}






/* search bar */

.category-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.search-box input[type="text"] {
  padding: 0.5rem 1rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  width: 250px;
  font-size: 0.95rem;
}

.pagination-controls {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pagination-controls button {
  background-color: #f4f4f4;
  border: 1px solid #ccc;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background-color 0.3s ease;
}

.pagination-controls button:hover {
  background-color: #e0e0e0;
}

.pagination-controls button.active-page {
  background-color: #007bff;
  color: white;
  font-weight: bold;
  border-color: #007bff;
}










/* Sidebar */






/* --- Base / mobile-first (unchanged) --- */
.sidebar {
  width: 240px;
  background-color: #ffffff;
  border-right: 1px solid #e5e7eb;
  padding: 20px 16px;
  position: fixed;
  top: 0;
  bottom: 0;
  left: -250px;                  /* hidden by default on mobile */
  z-index: 1000;
  transition: left .3s ease, width .3s ease, padding .3s ease;
  overflow-y: auto;
}
.sidebar.active { left: 0; }

.main-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin-left: 0;
  transition: margin-left .3s ease;
}

/* --- Desktop behavior: full vs. mini --- */
@media (min-width: 769px) {
  /* Default desktop: full width */
  .sidebar { left: 0; width: 240px; }
  .main-content { margin-left: 240px; }

  /* Collapsed desktop: mini icon rail (keep sidebar visible) */
  body.sidebar-collapsed .sidebar {
    width: 64px;                /* mini width */
    padding: 20px 8px;          /* tighter padding */
  }
  body.sidebar-collapsed .main-content { margin-left: 64px; }

  /* Hide brand text, keep logo icon */
  body.sidebar-collapsed .sidebar-title { display: none; }

  /* Make links icon-only in mini mode */
  body.sidebar-collapsed .sidebar-menu a {
    justify-content: center;
    padding: 10px;
    border-radius: 8px;
    font-size: 0;               /* hide link text without extra markup */
    gap: 0;
  }
  /* Feather -> SVG icons size in mini mode */
  body.sidebar-collapsed .sidebar-menu a svg {
    width: 22px;
    height: 22px;
    margin: 0;
  }

  /* Submenus never show while collapsed */
  body.sidebar-collapsed .submenu { display: none !important; }
  body.sidebar-collapsed .menu-group.open { /* prevent accidental open state */ }
}

/* Optional: nicer hover feedback on desktop */
@media (min-width: 769px) {
  .sidebar-menu a:hover,
  .sidebar-menu a.active {
    background-color: #f3f4f6;
    color: #111827;
  }
}




.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

.logo-icon,
.logo-full {
  width: 32px;
  height: auto;
  object-fit: contain;
  transition: opacity 0.3s ease;
}

/* By default, show full logo and hide icon */
.logo-icon { display: none; }
.logo-full { display: inline; object-fit: cover; margin-top: -11px;}

/* When collapsed, show icon and hide full logo */
body.sidebar-collapsed .logo-icon { display: inline; }
body.sidebar-collapsed .logo-full { display: none; }




.logo-crop {
  width: 120px;                 /* Fixed width */
  height: 40px;                 /* Fixed height */
  overflow: hidden;
}

.logo-crop img {
  width: 100%;
  height: 100%;
  object-fit: cover;            /* This does the cropping */
}





.profile-dropdown-wrapper {
  position: relative;
}

.profile-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid #e5e7eb;
  padding: 6px 8px;
  border-radius: 999px;
  cursor: pointer;
}

.profile-toggle .avatar {
  width: 28px; height: 28px; border-radius: 50%; object-fit: cover;
}

.profile-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px;
  width: 280px;
  z-index: 1200;
  box-shadow: 0 10px 24px rgba(0,0,0,0.08);
  display: none; /* default hidden */
}
.profile-dropdown.open { display: block; } /* class toggle */

.profile-card {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}
.profile-card .profile-avatar img {
  width: 48px; height: 48px; border-radius: 50%; object-fit: cover;
}

.dropdown-actions {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  border-top: 1px solid #f3f4f6; padding-top: 10px; margin-top: 8px;
}
.dropdown-actions a {
  color: #111827; text-decoration: none; font-size: 14px;
}
.dropdown-logout {
  background: #ef4444; color: #fff; border: none; border-radius: 6px;
  padding: 8px 10px; cursor: pointer;
}






/* When sidebar is collapsed */
body.sidebar-collapsed .logout-label {
  display: none; /* Hide text */
}

body.sidebar-collapsed .logout-btn {
  justify-content: center;
  padding: 10px;
}

.logout-btn:hover {
  background: #f6df13;
}






