.agro-activities-body {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  height: 88vh;                  /* bounded height so the table region scrolls */

  display: block;
  overflow-y: auto !important;
  overflow-x: hidden !important;

  padding-top: 3px;
  padding-bottom: 12px;
  overscroll-behavior: contain;
}

/* Keep the Activity Diary title + buttons row pinned at the top of the
   scrolling container so it never scrolls away with the table content. */
.agro-activities-body > .container-fluid > .row:first-of-type {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #fff;
  padding-top: 4px;
  padding-bottom: 6px;
  margin-bottom: 0 !important;  /* override mb-2 so no gap appears under the stuck bar */
}

/* =========================================================
   PROFESSIONAL POLISH — matching agro insights style
   ========================================================= */

/* ── Tabs ── */
#agro-activities-tabs .nav-tabs {
  border-bottom: 2px solid #dde2ea;
}

#agro-activities-tabs .nav-link {
  font-size: 0.88rem;
  font-weight: 500;
  color: #64748b;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 0.5rem 1rem;
  transition: color 0.15s ease, border-color 0.15s ease;
  margin-bottom: -2px;
}

#agro-activities-tabs .nav-link:hover {
  color: #177da5;
  border-bottom-color: #177da5;
  background: transparent;
}

#agro-activities-tabs .nav-link.active {
  color: #177da5 !important;
  border-bottom: 2px solid #177da5 !important;
  font-weight: 600 !important;
  background: transparent !important;
}

/* ── Cards inside tabs ── */
#agro-activities-tabs .card {
  border: 1px solid #dde2ea;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(15,23,42,0.07);
}

#agro-activities-tabs .card-body {
  padding: 0.75rem;
}

/* ── Activity reports graph ── */
#activity-reports-graph {
  border-radius: 8px;
  overflow: hidden;
}



/* ── Report controls labels ── */
.fw-semibold {
  font-size: 0.82rem;
  color: #64748b;
  letter-spacing: 0.02em;
}

/* ── Offcanvas ── */
#activity-diary-edit-offcanvas .offcanvas-header,
#activity-diary-add-offcanvas .offcanvas-header {
  background: #f4f6f9;
  border-bottom: 1px solid #dde2ea;
  font-weight: 600;
  font-size: 1rem;
  color: #1f2a37;
}

#activity-diary-edit-offcanvas,
#activity-diary-add-offcanvas {
  box-shadow: -4px 0 20px rgba(15,23,42,0.12);
}

/* ── Dropdowns inside report controls ── */
#activity-reports-graph-type .Select-control,
#activity-reports-x-axis .Select-control,
#activity-reports-y-axis .Select-control,
#activity-reports-color-axis .Select-control,
#activity-reports-agg-func .Select-control {
  border-color: #c9d2e0 !important;
  border-radius: 6px !important;
  font-size: 0.85rem !important;
}

/* Activity Diary only: fixed-width columns and readable full header labels. */
#activity-diary-table .dash-header .column-header-name {
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.25;
}
#activity-diary-table .dash-filter input {
  min-width: 0;
  max-width: 100%;
}
#activity-diary-table .dash-cell div.dash-cell-value {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Dash 3.1 caps frozen-column tables at 500px by default. Use this diary's
   available width while keeping horizontal scrolling inside the table. */
#activity-diary-table .dash-spreadsheet.dash-freeze-left {
  width: 100%;
  max-width: 100% !important;
}
