/* ============================================================
   BODY — removed height:100vh and overflow:hidden
   These two lines were the root cause of all scroll problems.
   Page now grows naturally with content.
============================================================ */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;   /* at least full screen tall, but CAN grow taller */
  margin: 0;
  /* overflow: hidden  ← REMOVED — this was cutting off all vertical content */
}

.navbar {
  background-color: #ffffff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar .nav-link {
  color: #4285f4;
}

.navbar .nav-link:hover {
  color: #357ae8;
}

.navbar-brand img {
  width: 40px;
  height: 40px;
}

/* ============================================================
   SIDEBAR — keep your blue color, but let it scroll internally
   on desktop. Mobile sidebar is handled by the layout template.
============================================================ */
#sidebar {
  background-color: #334091;
  color: white;
  width: 250px;
  padding: 20px;
  flex-shrink: 0;
  /* Desktop: sticky sidebar fills full remaining screen height */
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

#sidebar .nav-link {
  color: white;
}

#sidebar .nav-link:hover {
  background-color: #3f50b5;
}

#sidebar .submenu {
  padding-left: 20px;
}

/* ============================================================
   MAIN CONTENT — grows with content, page scrolls naturally.
   Removed overflow-y:auto which was trapping scroll inside div.
============================================================ */
#main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  /* overflow-y: auto  ← REMOVED — was trapping scroll inside this div */
}

/* ============================================================
   FLEX-FILL WRAPPER — removed fixed height that was capping
   the layout to exactly one screen height.
============================================================ */
.flex-fill {
  display: flex;
  /* height: calc(100vh - 56px)  ← REMOVED — was cutting content at screen bottom */
}

.content-area {
  padding: 20px;
  width: 100%;
  /* overflow-y: auto  ← NOT set — page scrolls, not this div */
}

/* ============================================================
   MOBILE SIDEBAR — override sticky desktop position so the
   sidebar becomes a fixed off-canvas drawer.
============================================================ */
@media (max-width: 991.98px) {
  #sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 260px !important;
    height: 100% !important;
    max-height: 100% !important;
    overflow-y: auto !important;
    z-index: 1050;
    transform: translateX(-110%);
    transition: transform 0.3s ease;
    box-shadow: 3px 0 15px rgba(0,0,0,0.25);
  }
  #sidebar.open {
    transform: translateX(0) !important;
  }
  #main-content {
    width: 100%;
  }
}

/* ============================================================
   Everything below is unchanged from your original common.css
============================================================ */

#canvasContainer { max-width: 100%; text-align: center; }
canvas { max-width: 100%; border: 0px solid black; }
#croppedImage { max-width: 100%; margin-top: 10px; }

.custom-tooltip .tooltip-inner {
  background-color: #34A853;
  color: #ffffff;
  font-size: 14px;
  text-transform: uppercase;
  padding: 8px 12px;
  border-radius: 5px;
}

.custom-tooltip.bs-tooltip-top .tooltip-arrow::before {
    border-top-color: #5a5a5a;
}
.custom-tooltip.bs-tooltip-bottom .tooltip-arrow::before {
    border-bottom-color: #5a5a5a;
}
.custom-tooltip.bs-tooltip-start .tooltip-arrow::before {
    border-left-color: #5a5a5a;
}
.custom-tooltip.bs-tooltip-end .tooltip-arrow::before {
    border-right-color: #5a5a5a;
}

.timeline-container {
  position: relative;
  margin-left: 15px;
}

.timeline-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 12px;
  width: 2px;
  height: 100%;
  background-color: #0d6efd;
  z-index: 0;
}

.timeline-card {
  position: relative;
  margin-left: 30px;
  z-index: 1;
  transition: all 0.2s ease-in-out;
}

.timeline-card::before {
  content: '';
  position: absolute;
  left: -18px;
  top: 20px;
  width: 10px;
  height: 10px;
  background-color: #0d6efd;
  border-radius: 50%;
  border: 2px solid #fff;
  z-index: 2;
}

.timeline-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.1);
}

.bootstrap-select .dropdown-toggle {
  text-transform: capitalize !important;
}

#pagination_Number {
  display: flex;
  overflow-x: auto;
  white-space: nowrap;
  max-width: 100%;
  padding: 5px;
  gap: 5px;
  scrollbar-width: thin;
  scrollbar-color: #ccc transparent;
}

#pagination_Number::-webkit-scrollbar {
  height: 6px;
}

#pagination_Number::-webkit-scrollbar-thumb {
  background-color: #aaa;
  border-radius: 3px;
}

#pagination_Number li {
  flex-shrink: 0;
}

#pagination_Number .page-link {
  min-width: 40px;
  text-align: center;
}

.card {
  transition: transform 0.3s ease-in-out;
}
.card:hover {
  transform: translateY(-5px);
}
.commission-card {
  background: #f8f9fa;
}
.commission-card:hover {
  background: #e9ecef;
}
.bg-gradient {
  background: linear-gradient(45deg, #007bff, #00b4db);
}
.bg-success {
  background: linear-gradient(45deg, #28a745, #34d058);
}

@media (max-width: 576px) {
  .card-header h4 {
    font-size: 1.25rem;
  }
  .table {
    font-size: 0.8rem;
  }
  .table td, .table th {
    padding: 0.5rem;
  }
  .commission-card h6 {
    font-size: 0.9rem;
  }
}

@media (min-width: 577px) and (max-width: 991px) {
  .card-body {
    padding: 1.5rem !important;
  }
  .table {
    font-size: 0.9rem;
  }
}

.avatar {
  font-weight: 600;
  text-transform: uppercase;
}

.table-row-hover:hover {
  background-color: #f8f9fa;
  transition: background-color 0.2s ease;
}

.badge {
  font-weight: 500;
  border-radius: 999px;
}
